本文整理汇总了Java中com.sun.xml.internal.ws.fault.SOAPFaultBuilder.createException方法的典型用法代码示例。如果您正苦于以下问题:Java SOAPFaultBuilder.createException方法的具体用法?Java SOAPFaultBuilder.createException怎么用?Java SOAPFaultBuilder.createException使用的例子?那么恭喜您, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类com.sun.xml.internal.ws.fault.SOAPFaultBuilder
的用法示例。
在下文中一共展示了SOAPFaultBuilder.createException方法的2个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的Java代码示例。
示例1: readResponse
import com.sun.xml.internal.ws.fault.SOAPFaultBuilder; //导入方法依赖的package包/类
public JavaCallInfo readResponse(Packet p, JavaCallInfo call) throws Throwable {
Message msg = p.getMessage();
if(msg.isFault()) {
SOAPFaultBuilder faultBuilder = SOAPFaultBuilder.create(msg);
Throwable t = faultBuilder.createException(checkedExceptions);
call.setException(t);
throw t;
} else {
initArgs(call.getParameters());
Object ret = responseBuilder.readResponse(msg, call.getParameters());
call.setReturnValue(ret);
return call;
}
}
示例2: do_run
import com.sun.xml.internal.ws.fault.SOAPFaultBuilder; //导入方法依赖的package包/类
public void do_run () {
Packet req = new Packet(createRequestMessage(args));
req.soapAction = soapAction;
req.expectReply = !isOneWay;
req.getMessage().assertOneWay(isOneWay);
Fiber.CompletionCallback callback = new Fiber.CompletionCallback() {
public void onCompletion(@NotNull Packet response) {
responseImpl.setResponseContext(new ResponseContext(response));
Message msg = response.getMessage();
if (msg == null) {
return;
}
try {
if(msg.isFault()) {
SOAPFaultBuilder faultBuilder = SOAPFaultBuilder.create(msg);
throw faultBuilder.createException(checkedExceptions);
} else {
Object[] rargs = new Object[1];
if (asyncBeanClass != null) {
rargs[0] = asyncBeanClass.newInstance();
}
responseBuilder.readResponse(msg, rargs);
responseImpl.set(rargs[0], null);
}
} catch (Throwable t) {
if (t instanceof RuntimeException) {
if (t instanceof WebServiceException) {
responseImpl.set(null, t);
return;
}
} else if (t instanceof Exception) {
responseImpl.set(null, t);
return;
}
//its RuntimeException or some other exception resulting from user error, wrap it in
// WebServiceException
responseImpl.set(null, new WebServiceException(t));
}
}
public void onCompletion(@NotNull Throwable error) {
if (error instanceof WebServiceException) {
responseImpl.set(null, error);
} else {
//its RuntimeException or some other exception resulting from user error, wrap it in
// WebServiceException
responseImpl.set(null, new WebServiceException(error));
}
}
};
owner.doProcessAsync(req, rc, callback);
}