• 设为首页
  • 点击收藏
  • 手机版
    手机扫一扫访问
    迪恩网络手机版
  • 关注官方公众号
    微信扫一扫关注
    公众号

Java DispatchException类代码示例

原作者: [db:作者] 来自: [db:来源] 收藏 邀请

本文整理汇总了Java中com.sun.xml.internal.ws.wsdl.DispatchException的典型用法代码示例。如果您正苦于以下问题:Java DispatchException类的具体用法?Java DispatchException怎么用?Java DispatchException使用的例子?那么恭喜您, 这里精选的类代码示例或许可以为您提供帮助。



DispatchException类属于com.sun.xml.internal.ws.wsdl包,在下文中一共展示了DispatchException类的9个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于我们的系统推荐出更棒的Java代码示例。

示例1: getWSDLOperationMapping

import com.sun.xml.internal.ws.wsdl.DispatchException; //导入依赖的package包/类
/**
     *
     * @return not null if it finds a unique handler for the request
     *         null if it cannot idenitify a unique wsdl operation from the Payload QName.
     *
     * @throws DispatchException if the payload itself is incorrect, this happens when the payload is not accepted by
     *          any operation in the port.
     */
//  public QName getWSDLOperationQName(Packet request) throws DispatchException{

    public WSDLOperationMapping getWSDLOperationMapping(Packet request) throws DispatchException {
        Message message = request.getMessage();
        String localPart = message.getPayloadLocalPart();
        String nsUri;
        if (localPart == null) {
            localPart = EMPTY_PAYLOAD_LOCAL;
            nsUri = EMPTY_PAYLOAD_NSURI;
        } else {
            nsUri = message.getPayloadNamespaceURI();
            if(nsUri == null)
                nsUri = EMPTY_PAYLOAD_NSURI;
        }
        WSDLOperationMapping op = methodHandlers.get(nsUri, localPart);

        // Check if payload itself is correct. Usually it is, so let us check last
        if (op == null && !unique.containsKey(nsUri,localPart)) {
            String dispatchKey = "{" + nsUri + "}" + localPart;
            String faultString = ServerMessages.DISPATCH_CANNOT_FIND_METHOD(dispatchKey);
            throw new DispatchException(SOAPFaultBuilder.createSOAPFaultMessage(
                 binding.getSOAPVersion(), faultString, binding.getSOAPVersion().faultCodeClient));
        }
        return op;
    }
 
开发者ID:SunburstApps,项目名称:OpenJSharp,代码行数:34,代码来源:PayloadQNameBasedOperationFinder.java


示例2: getWSDLOperationQName

import com.sun.xml.internal.ws.wsdl.DispatchException; //导入依赖的package包/类
/**
 *
 * @return not null if it finds a unique handler for the request
 *         null if it cannot idenitify a unique wsdl operation from the Payload QName.
 *
 * @throws DispatchException if the payload itself is incorrect, this happens when the payload is not accepted by
 *          any operation in the port.
 */
public QName getWSDLOperationQName(Packet request) throws DispatchException{
    Message message = request.getMessage();
    String localPart = message.getPayloadLocalPart();
    String nsUri;
    if (localPart == null) {
        localPart = EMPTY_PAYLOAD_LOCAL;
        nsUri = EMPTY_PAYLOAD_NSURI;
    } else {
        nsUri = message.getPayloadNamespaceURI();
        if(nsUri == null)
            nsUri = EMPTY_PAYLOAD_NSURI;
    }
    QName op = methodHandlers.get(nsUri, localPart);

    // Check if payload itself is correct. Usually it is, so let us check last
    if (op == null && !unique.containsKey(nsUri,localPart)) {
        String dispatchKey = "{" + nsUri + "}" + localPart;
        String faultString = ServerMessages.DISPATCH_CANNOT_FIND_METHOD(dispatchKey);
        throw new DispatchException(SOAPFaultBuilder.createSOAPFaultMessage(
             binding.getSOAPVersion(), faultString, binding.getSOAPVersion().faultCodeClient));
    }
    return op;
}
 
开发者ID:alexkasko,项目名称:openjdk-icedtea7,代码行数:32,代码来源:PayloadQNameBasedOperationFinder.java


示例3: getWSDLOperationMapping

import com.sun.xml.internal.ws.wsdl.DispatchException; //导入依赖的package包/类
public WSDLOperationMapping getWSDLOperationMapping() {
    if (wsdlOperationMapping != null) return wsdlOperationMapping;
    OperationDispatcher opDispatcher = null;
    if (endpoint != null) {
        opDispatcher = endpoint.getOperationDispatcher();
    } else if (proxy != null) {
        opDispatcher = ((Stub) proxy).getOperationDispatcher();
    }
    //OpDispatcher is null when there is no WSDLModel
    if (opDispatcher != null) {
        try {
            wsdlOperationMapping = opDispatcher.getWSDLOperationMapping(this);
        } catch (DispatchException e) {
            //Ignore, this might be a protocol message which may not have a wsdl operation
            //LOGGER.info("Cannot resolve wsdl operation that this Packet is targeted for.");
        }
    }
    return wsdlOperationMapping;
}
 
开发者ID:SunburstApps,项目名称:OpenJSharp,代码行数:20,代码来源:Packet.java


示例4: createResponse

import com.sun.xml.internal.ws.wsdl.DispatchException; //导入依赖的package包/类
public Message createResponse(JavaCallInfo call) {
        Message responseMessage;
        if (call.getException() == null) {
            responseMessage = isOneWay ? null : createResponseMessage(call.getParameters(), call.getReturnValue());
        } else {
            Throwable e = call.getException();
            Throwable serviceException = getServiceException(e);
            if (e instanceof InvocationTargetException || serviceException != null) {
//              Throwable cause = e.getCause();
              //if (!(cause instanceof RuntimeException) && cause instanceof Exception) {
                if (serviceException != null) {
                    // Service specific exception
                    LOGGER.log(Level.FINE, serviceException.getMessage(), serviceException);
                    responseMessage = SOAPFaultBuilder.createSOAPFaultMessage(soapVersion,
                            javaMethodModel.getCheckedException(serviceException.getClass()), serviceException);
                } else {
                    Throwable cause = e.getCause();
                    if (cause instanceof ProtocolException) {
                        // Application code may be throwing it intentionally
                        LOGGER.log(Level.FINE, cause.getMessage(), cause);
                    } else {
                        // Probably some bug in application code
                        LOGGER.log(Level.SEVERE, cause.getMessage(), cause);
                    }
                    responseMessage = SOAPFaultBuilder.createSOAPFaultMessage(soapVersion, null, cause);
                }
            } else if (e instanceof DispatchException) {
                responseMessage = ((DispatchException)e).fault;
            } else {
                LOGGER.log(Level.SEVERE, e.getMessage(), e);
                responseMessage = SOAPFaultBuilder.createSOAPFaultMessage(soapVersion, null, e);
            }
        }
//        return req.createServerResponse(responseMessage, req.endpoint.getPort(), javaMethodModel.getOwner(), req.endpoint.getBinding());

        return responseMessage;
    }
 
开发者ID:SunburstApps,项目名称:OpenJSharp,代码行数:38,代码来源:TieHandler.java


示例5: serializeResponse

import com.sun.xml.internal.ws.wsdl.DispatchException; //导入依赖的package包/类
@Override
public Packet serializeResponse(JavaCallInfo call) {
    Method method = call.getMethod();
    Message message = null;
    if (method != null) {
        TieHandler th = tieHandlers.get(method);
        if (th != null) {
            return th.serializeResponse(call);
        }
    }
    if (call.getException() instanceof DispatchException) {
        message = ((DispatchException) call.getException()).fault;
    }
    Packet p = (Packet) packetFactory.createContext(message);
    p.setState(Packet.State.ServerResponse);
    return p;
}
 
开发者ID:SunburstApps,项目名称:OpenJSharp,代码行数:18,代码来源:DatabindingImpl.java


示例6: getWSDLOperation

import com.sun.xml.internal.ws.wsdl.DispatchException; //导入依赖的package包/类
/**
 * Returns the QName of the wsdl operation associated with this packet.
 * <p/>
 * Information such as Payload QName, wsa:Action header, SOAPAction HTTP header are used depending on the features
 * enabled on the particular port.
 *
 * @return null if there is no WSDL model or
 *              runtime cannot uniquely identify the wsdl operation from the information in the packet.
 */
@Property(MessageContext.WSDL_OPERATION)
public final @Nullable QName getWSDLOperation(){
    if(wsdlOperation != null)
        return wsdlOperation;

    OperationDispatcher opDispatcher = null;
    if(endpoint != null) {
        opDispatcher = ((WSEndpointImpl)endpoint).getOperationDispatcher();
    } else if (proxy != null) {
        opDispatcher = ((Stub)proxy).getOperationDispatcher();
    }
    //OpDispatcher is null when there is no WSDLModel
    if(opDispatcher != null) {
        try {
            wsdlOperation = opDispatcher.getWSDLOperationQName(this);
        } catch (DispatchException e) {
            //Ignore, this might be a protocol message which may not have a wsdl operation
            //LOGGER.info("Cannot resolve wsdl operation that this Packet is targeted for.");
        }
    }
    return wsdlOperation;
}
 
开发者ID:alexkasko,项目名称:openjdk-icedtea7,代码行数:32,代码来源:Packet.java


示例7: resolveJavaMethod

import com.sun.xml.internal.ws.wsdl.DispatchException; //导入依赖的package包/类
JavaMethodImpl resolveJavaMethod(Packet req) throws DispatchException {
    WSDLOperationMapping m = req.getWSDLOperationMapping();
    if (m == null) {
        synchronized (this) {
            m = (operationDispatcher != null)
                    ? operationDispatcher.getWSDLOperationMapping(req)
                    : operationDispatcherNoWsdl.getWSDLOperationMapping(req);
        }
    }
    return (JavaMethodImpl) m.getJavaMethod();
}
 
开发者ID:SunburstApps,项目名称:OpenJSharp,代码行数:12,代码来源:DatabindingImpl.java


示例8: deserializeRequest

import com.sun.xml.internal.ws.wsdl.DispatchException; //导入依赖的package包/类
public JavaCallInfo deserializeRequest(Packet req) {
    com.sun.xml.internal.ws.api.databinding.JavaCallInfo call = new com.sun.xml.internal.ws.api.databinding.JavaCallInfo();
    try {
        JavaMethodImpl wsdlOp = resolveJavaMethod(req);
        TieHandler tie = wsdlOpMap.get(wsdlOp);
        call.setMethod(tie.getMethod());
        Object[] args = tie.readRequest(req.getMessage());
        call.setParameters(args);
    } catch (DispatchException e) {
        call.setException(e);
    }
    return call;
}
 
开发者ID:SunburstApps,项目名称:OpenJSharp,代码行数:14,代码来源:DatabindingImpl.java


示例9: getEndpointBridge

import com.sun.xml.internal.ws.wsdl.DispatchException; //导入依赖的package包/类
@Override
public EndpointCallBridge getEndpointBridge(Packet req) throws DispatchException {
    JavaMethodImpl wsdlOp = resolveJavaMethod(req);
    return wsdlOpMap.get(wsdlOp);
}
 
开发者ID:SunburstApps,项目名称:OpenJSharp,代码行数:6,代码来源:DatabindingImpl.java



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


鲜花

握手

雷人

路过

鸡蛋
该文章已有0人参与评论

请发表评论

全部评论

专题导读
上一篇:
Java OracleDatabase类代码示例发布时间:2022-05-23
下一篇:
Java Acceleration类代码示例发布时间:2022-05-23
热门推荐
阅读排行榜

扫描微信二维码

查看手机版网站

随时了解更新最新资讯

139-2527-9053

在线客服(服务时间 9:00~18:00)

在线QQ客服
地址:深圳市南山区西丽大学城创智工业园
电邮:jeky_zhao#qq.com
移动电话:139-2527-9053

Powered by 互联科技 X3.4© 2001-2213 极客世界.|Sitemap