当前位置: 首页>>代码示例>>Java>>正文


Java SOAPFaultBuilder.createException方法代码示例

本文整理汇总了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;
}
}
 
开发者ID:SunburstApps,项目名称:OpenJSharp,代码行数:15,代码来源:StubHandler.java

示例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);
}
 
开发者ID:alexkasko,项目名称:openjdk-icedtea7,代码行数:56,代码来源:AsyncMethodHandler.java


注:本文中的com.sun.xml.internal.ws.fault.SOAPFaultBuilder.createException方法示例由纯净天空整理自Github/MSDocs等开源代码及文档管理平台,相关代码片段筛选自各路编程大神贡献的开源项目,源码版权归原作者所有,传播和使用请参考对应项目的License;未经允许,请勿转载。