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


Java DispatchException类代码示例

本文整理汇总了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;未经允许,请勿转载。