javax.xml.ws.Service.Mode Java Examples

The following examples show how to use javax.xml.ws.Service.Mode. You can vote up the ones you like or vote down the ones you don't like, and go to the original project or source file by following the links above each example. You may check out the related API usage on the sidebar.
Example #1
Source File: Stubs.java    From openjdk-jdk8u with GNU General Public License v2.0 6 votes vote down vote up
/**
 * Creates a new {@link Dispatch} stub that connects to the given pipe.
 *
 * @param portInfo
 *      see <a href="#param">common parameters</a>
 * @param owner
 *      see <a href="#param">common parameters</a>
 * @param binding
 *      see <a href="#param">common parameters</a>
 * @param clazz
 *      Type of the {@link Dispatch} to be created.
 *      See {@link Service#createDispatch(QName, Class, Service.Mode)}.
 * @param mode
 *      The mode of the dispatch.
 *      See {@link Service#createDispatch(QName, Class, Service.Mode)}.
 * @param epr
 *      see <a href="#param">common parameters</a>
 * TODO: are these parameters making sense?
 */
public static <T> Dispatch<T> createDispatch(WSPortInfo portInfo,
                                             WSService owner,
                                             WSBinding binding,
                                             Class<T> clazz, Service.Mode mode,
                                             @Nullable WSEndpointReference epr) {
    if (clazz == SOAPMessage.class) {
        return (Dispatch<T>) createSAAJDispatch(portInfo, binding, mode, epr);
    } else if (clazz == Source.class) {
        return (Dispatch<T>) createSourceDispatch(portInfo, binding, mode, epr);
    } else if (clazz == DataSource.class) {
        return (Dispatch<T>) createDataSourceDispatch(portInfo, binding, mode, epr);
    } else if (clazz == Message.class) {
        if(mode==Mode.MESSAGE)
            return (Dispatch<T>) createMessageDispatch(portInfo, binding, epr);
        else
            throw new WebServiceException(mode+" not supported with Dispatch<Message>");
    } else if (clazz == Packet.class) {
        if(mode==Mode.MESSAGE)
            return (Dispatch<T>) createPacketDispatch(portInfo, binding, epr);
        else
            throw new WebServiceException(mode+" not supported with Dispatch<Packet>");
    } else
        throw new WebServiceException("Unknown class type " + clazz.getName());
}
 
Example #2
Source File: Stubs.java    From jdk8u60 with GNU General Public License v2.0 6 votes vote down vote up
/**
 * Creates a new {@link Dispatch} stub that connects to the given pipe.
 *
 * @param portName
 *      see {@link Service#createDispatch(QName, Class, Service.Mode)}.
 * @param owner
 *      see <a href="#param">common parameters</a>
 * @param binding
 *      see <a href="#param">common parameters</a>
 * @param clazz
 *      Type of the {@link Dispatch} to be created.
 *      See {@link Service#createDispatch(QName, Class, Service.Mode)}.
 * @param mode
 *      The mode of the dispatch.
 *      See {@link Service#createDispatch(QName, Class, Service.Mode)}.
 * @param next
 *      see <a href="#param">common parameters</a>
 * @param epr
 *      see <a href="#param">common parameters</a>
 * TODO: are these parameters making sense?
 */
@SuppressWarnings("unchecked")
    public static <T> Dispatch<T> createDispatch(QName portName,
                                             WSService owner,
                                             WSBinding binding,
                                             Class<T> clazz, Service.Mode mode, Tube next,
                                             @Nullable WSEndpointReference epr) {
    if (clazz == SOAPMessage.class) {
        return (Dispatch<T>) createSAAJDispatch(portName, owner, binding, mode, next, epr);
    } else if (clazz == Source.class) {
        return (Dispatch<T>) createSourceDispatch(portName, owner, binding, mode, next, epr);
    } else if (clazz == DataSource.class) {
        return (Dispatch<T>) createDataSourceDispatch(portName, owner, binding, mode, next, epr);
    } else if (clazz == Message.class) {
        if(mode==Mode.MESSAGE)
            return (Dispatch<T>) createMessageDispatch(portName, owner, binding, next, epr);
        else
            throw new WebServiceException(mode+" not supported with Dispatch<Message>");
    } else if (clazz == Packet.class) {
        return (Dispatch<T>) createPacketDispatch(portName, owner, binding, next, epr);
    } else
        throw new WebServiceException("Unknown class type " + clazz.getName());
}
 
Example #3
Source File: Stubs.java    From TencentKona-8 with GNU General Public License v2.0 6 votes vote down vote up
/**
 * Creates a new {@link Dispatch} stub that connects to the given pipe.
 *
 * @param portName
 *      see {@link Service#createDispatch(QName, Class, Service.Mode)}.
 * @param owner
 *      see <a href="#param">common parameters</a>
 * @param binding
 *      see <a href="#param">common parameters</a>
 * @param clazz
 *      Type of the {@link Dispatch} to be created.
 *      See {@link Service#createDispatch(QName, Class, Service.Mode)}.
 * @param mode
 *      The mode of the dispatch.
 *      See {@link Service#createDispatch(QName, Class, Service.Mode)}.
 * @param next
 *      see <a href="#param">common parameters</a>
 * @param epr
 *      see <a href="#param">common parameters</a>
 * TODO: are these parameters making sense?
 */
@SuppressWarnings("unchecked")
    public static <T> Dispatch<T> createDispatch(QName portName,
                                             WSService owner,
                                             WSBinding binding,
                                             Class<T> clazz, Service.Mode mode, Tube next,
                                             @Nullable WSEndpointReference epr) {
    if (clazz == SOAPMessage.class) {
        return (Dispatch<T>) createSAAJDispatch(portName, owner, binding, mode, next, epr);
    } else if (clazz == Source.class) {
        return (Dispatch<T>) createSourceDispatch(portName, owner, binding, mode, next, epr);
    } else if (clazz == DataSource.class) {
        return (Dispatch<T>) createDataSourceDispatch(portName, owner, binding, mode, next, epr);
    } else if (clazz == Message.class) {
        if(mode==Mode.MESSAGE)
            return (Dispatch<T>) createMessageDispatch(portName, owner, binding, next, epr);
        else
            throw new WebServiceException(mode+" not supported with Dispatch<Message>");
    } else if (clazz == Packet.class) {
        return (Dispatch<T>) createPacketDispatch(portName, owner, binding, next, epr);
    } else
        throw new WebServiceException("Unknown class type " + clazz.getName());
}
 
Example #4
Source File: Stubs.java    From TencentKona-8 with GNU General Public License v2.0 6 votes vote down vote up
/**
 * Creates a new {@link Dispatch} stub that connects to the given pipe.
 *
 * @param portInfo
 *      see <a href="#param">common parameters</a>
 * @param owner
 *      see <a href="#param">common parameters</a>
 * @param binding
 *      see <a href="#param">common parameters</a>
 * @param clazz
 *      Type of the {@link Dispatch} to be created.
 *      See {@link Service#createDispatch(QName, Class, Service.Mode)}.
 * @param mode
 *      The mode of the dispatch.
 *      See {@link Service#createDispatch(QName, Class, Service.Mode)}.
 * @param epr
 *      see <a href="#param">common parameters</a>
 * TODO: are these parameters making sense?
 */
public static <T> Dispatch<T> createDispatch(WSPortInfo portInfo,
                                             WSService owner,
                                             WSBinding binding,
                                             Class<T> clazz, Service.Mode mode,
                                             @Nullable WSEndpointReference epr) {
    if (clazz == SOAPMessage.class) {
        return (Dispatch<T>) createSAAJDispatch(portInfo, binding, mode, epr);
    } else if (clazz == Source.class) {
        return (Dispatch<T>) createSourceDispatch(portInfo, binding, mode, epr);
    } else if (clazz == DataSource.class) {
        return (Dispatch<T>) createDataSourceDispatch(portInfo, binding, mode, epr);
    } else if (clazz == Message.class) {
        if(mode==Mode.MESSAGE)
            return (Dispatch<T>) createMessageDispatch(portInfo, binding, epr);
        else
            throw new WebServiceException(mode+" not supported with Dispatch<Message>");
    } else if (clazz == Packet.class) {
        if(mode==Mode.MESSAGE)
            return (Dispatch<T>) createPacketDispatch(portInfo, binding, epr);
        else
            throw new WebServiceException(mode+" not supported with Dispatch<Packet>");
    } else
        throw new WebServiceException("Unknown class type " + clazz.getName());
}
 
Example #5
Source File: DispatchImpl.java    From openjdk-jdk8u with GNU General Public License v2.0 5 votes vote down vote up
public static void checkValidDataSourceDispatch(WSBinding binding, Service.Mode mode) {
    // Dispatch<DataSource> is only valid with xml/http binding and in Service.Mode.MESSAGE
    if (!DispatchImpl.isXMLHttp(binding))
        throw new WebServiceException(DispatchMessages.INVALID_DATASOURCE_DISPATCH_BINDING("SOAP/HTTP", HTTPBinding.HTTP_BINDING));
    if (DispatchImpl.isPAYLOADMode(mode))
        throw new WebServiceException(DispatchMessages.INVALID_DATASOURCE_DISPATCH_MSGMODE(mode.name(), Service.Mode.MESSAGE.toString()));
}
 
Example #6
Source File: DispatchImpl.java    From openjdk-jdk8u with GNU General Public License v2.0 5 votes vote down vote up
public static void checkValidSOAPMessageDispatch(WSBinding binding, Service.Mode mode) {
    // Dispatch<SOAPMessage> is only valid for soap binding and in Service.Mode.MESSAGE
    if (DispatchImpl.isXMLHttp(binding))
        throw new WebServiceException(DispatchMessages.INVALID_SOAPMESSAGE_DISPATCH_BINDING(HTTPBinding.HTTP_BINDING, SOAPBinding.SOAP11HTTP_BINDING + " or " + SOAPBinding.SOAP12HTTP_BINDING));
    if (DispatchImpl.isPAYLOADMode(mode))
        throw new WebServiceException(DispatchMessages.INVALID_SOAPMESSAGE_DISPATCH_MSGMODE(mode.name(), Service.Mode.MESSAGE.toString()));
}
 
Example #7
Source File: DispatchImpl.java    From jdk8u60 with GNU General Public License v2.0 5 votes vote down vote up
static void checkNullAllowed(@Nullable Object in, RequestContext rc, WSBinding binding, Service.Mode mode) {

        if (in != null)
            return;

        //With HTTP Binding a null invocation parameter can not be used
        //with HTTP Request Method == POST
        if (isXMLHttp(binding)){
            if (methodNotOk(rc))
                throw new WebServiceException(DispatchMessages.INVALID_NULLARG_XMLHTTP_REQUEST_METHOD(HTTP_REQUEST_METHOD_POST, HTTP_REQUEST_METHOD_GET));
        } else { //soapBinding
              if (mode == Service.Mode.MESSAGE )
                   throw new WebServiceException(DispatchMessages.INVALID_NULLARG_SOAP_MSGMODE(mode.name(), Service.Mode.PAYLOAD.toString()));
        }
    }
 
Example #8
Source File: DispatchImpl.java    From jdk8u60 with GNU General Public License v2.0 5 votes vote down vote up
public static void checkValidSOAPMessageDispatch(WSBinding binding, Service.Mode mode) {
    // Dispatch<SOAPMessage> is only valid for soap binding and in Service.Mode.MESSAGE
    if (DispatchImpl.isXMLHttp(binding))
        throw new WebServiceException(DispatchMessages.INVALID_SOAPMESSAGE_DISPATCH_BINDING(HTTPBinding.HTTP_BINDING, SOAPBinding.SOAP11HTTP_BINDING + " or " + SOAPBinding.SOAP12HTTP_BINDING));
    if (DispatchImpl.isPAYLOADMode(mode))
        throw new WebServiceException(DispatchMessages.INVALID_SOAPMESSAGE_DISPATCH_MSGMODE(mode.name(), Service.Mode.MESSAGE.toString()));
}
 
Example #9
Source File: DispatchImpl.java    From jdk8u60 with GNU General Public License v2.0 5 votes vote down vote up
public static void checkValidDataSourceDispatch(WSBinding binding, Service.Mode mode) {
    // Dispatch<DataSource> is only valid with xml/http binding and in Service.Mode.MESSAGE
    if (!DispatchImpl.isXMLHttp(binding))
        throw new WebServiceException(DispatchMessages.INVALID_DATASOURCE_DISPATCH_BINDING("SOAP/HTTP", HTTPBinding.HTTP_BINDING));
    if (DispatchImpl.isPAYLOADMode(mode))
        throw new WebServiceException(DispatchMessages.INVALID_DATASOURCE_DISPATCH_MSGMODE(mode.name(), Service.Mode.MESSAGE.toString()));
}
 
Example #10
Source File: DispatchImpl.java    From TencentKona-8 with GNU General Public License v2.0 5 votes vote down vote up
static void checkNullAllowed(@Nullable Object in, RequestContext rc, WSBinding binding, Service.Mode mode) {

        if (in != null)
            return;

        //With HTTP Binding a null invocation parameter can not be used
        //with HTTP Request Method == POST
        if (isXMLHttp(binding)){
            if (methodNotOk(rc))
                throw new WebServiceException(DispatchMessages.INVALID_NULLARG_XMLHTTP_REQUEST_METHOD(HTTP_REQUEST_METHOD_POST, HTTP_REQUEST_METHOD_GET));
        } else { //soapBinding
              if (mode == Service.Mode.MESSAGE )
                   throw new WebServiceException(DispatchMessages.INVALID_NULLARG_SOAP_MSGMODE(mode.name(), Service.Mode.PAYLOAD.toString()));
        }
    }
 
Example #11
Source File: DispatchImpl.java    From TencentKona-8 with GNU General Public License v2.0 5 votes vote down vote up
public static void checkValidSOAPMessageDispatch(WSBinding binding, Service.Mode mode) {
    // Dispatch<SOAPMessage> is only valid for soap binding and in Service.Mode.MESSAGE
    if (DispatchImpl.isXMLHttp(binding))
        throw new WebServiceException(DispatchMessages.INVALID_SOAPMESSAGE_DISPATCH_BINDING(HTTPBinding.HTTP_BINDING, SOAPBinding.SOAP11HTTP_BINDING + " or " + SOAPBinding.SOAP12HTTP_BINDING));
    if (DispatchImpl.isPAYLOADMode(mode))
        throw new WebServiceException(DispatchMessages.INVALID_SOAPMESSAGE_DISPATCH_MSGMODE(mode.name(), Service.Mode.MESSAGE.toString()));
}
 
Example #12
Source File: DispatchImpl.java    From TencentKona-8 with GNU General Public License v2.0 5 votes vote down vote up
public static void checkValidDataSourceDispatch(WSBinding binding, Service.Mode mode) {
    // Dispatch<DataSource> is only valid with xml/http binding and in Service.Mode.MESSAGE
    if (!DispatchImpl.isXMLHttp(binding))
        throw new WebServiceException(DispatchMessages.INVALID_DATASOURCE_DISPATCH_BINDING("SOAP/HTTP", HTTPBinding.HTTP_BINDING));
    if (DispatchImpl.isPAYLOADMode(mode))
        throw new WebServiceException(DispatchMessages.INVALID_DATASOURCE_DISPATCH_MSGMODE(mode.name(), Service.Mode.MESSAGE.toString()));
}
 
Example #13
Source File: DispatchImpl.java    From TencentKona-8 with GNU General Public License v2.0 5 votes vote down vote up
@Deprecated
public static Dispatch<Source> createSourceDispatch(QName port, Mode mode, WSServiceDelegate owner, Tube pipe, BindingImpl binding, WSEndpointReference epr) {
    if(isXMLHttp(binding))
        return new RESTSourceDispatch(port,mode,owner,pipe,binding,epr);
    else
        return new SOAPSourceDispatch(port,mode,owner,pipe,binding,epr);
}
 
Example #14
Source File: DispatchImpl.java    From openjdk-jdk8u with GNU General Public License v2.0 5 votes vote down vote up
@Deprecated
public static Dispatch<Source> createSourceDispatch(QName port, Mode mode, WSServiceDelegate owner, Tube pipe, BindingImpl binding, WSEndpointReference epr) {
    if(isXMLHttp(binding))
        return new RESTSourceDispatch(port,mode,owner,pipe,binding,epr);
    else
        return new SOAPSourceDispatch(port,mode,owner,pipe,binding,epr);
}
 
Example #15
Source File: RESTSourceDispatch.java    From openjdk-jdk8u with GNU General Public License v2.0 4 votes vote down vote up
public RESTSourceDispatch(WSPortInfo portInfo, Mode mode, BindingImpl binding, WSEndpointReference epr) {
    super(portInfo, mode, binding, epr);
    assert isXMLHttp(binding);
}
 
Example #16
Source File: MessageDispatch.java    From jdk8u60 with GNU General Public License v2.0 4 votes vote down vote up
@Deprecated
public MessageDispatch(QName port, WSServiceDelegate service, Tube pipe, BindingImpl binding, WSEndpointReference epr) {
    super(port, Mode.MESSAGE, service, pipe, binding, epr);
}
 
Example #17
Source File: RESTSourceDispatch.java    From jdk8u60 with GNU General Public License v2.0 4 votes vote down vote up
@Deprecated
public RESTSourceDispatch(QName port, Mode mode, WSServiceDelegate owner, Tube pipe, BindingImpl binding, WSEndpointReference epr) {
    super(port, mode, owner, pipe, binding, epr);
    assert isXMLHttp(binding);
}
 
Example #18
Source File: PacketDispatch.java    From jdk8u60 with GNU General Public License v2.0 4 votes vote down vote up
public PacketDispatch(WSPortInfo portInfo, Tube pipe, BindingImpl binding, WSEndpointReference epr, boolean allowFaultResponseMsg) {
    super(portInfo, Mode.MESSAGE, pipe, binding, epr, allowFaultResponseMsg);
    isDeliverThrowableInPacket = calculateIsDeliverThrowableInPacket(binding);
}
 
Example #19
Source File: RESTSourceDispatch.java    From jdk8u60 with GNU General Public License v2.0 4 votes vote down vote up
public RESTSourceDispatch(WSPortInfo portInfo, Mode mode, BindingImpl binding, WSEndpointReference epr) {
    super(portInfo, mode, binding, epr);
    assert isXMLHttp(binding);
}
 
Example #20
Source File: SOAPSourceDispatch.java    From jdk8u60 with GNU General Public License v2.0 4 votes vote down vote up
public SOAPSourceDispatch(WSPortInfo portInfo, Mode mode, BindingImpl binding, WSEndpointReference epr) {
        super(portInfo, mode, binding, epr);
        assert !isXMLHttp(binding);
}
 
Example #21
Source File: DispatchImpl.java    From jdk8u60 with GNU General Public License v2.0 4 votes vote down vote up
public static Dispatch<Source> createSourceDispatch(WSPortInfo portInfo, Mode mode, BindingImpl binding, WSEndpointReference epr) {
    if (isXMLHttp(binding))
        return new RESTSourceDispatch(portInfo, mode, binding, epr);
    else
        return new SOAPSourceDispatch(portInfo, mode, binding, epr);
}
 
Example #22
Source File: DispatchImpl.java    From jdk8u60 with GNU General Public License v2.0 4 votes vote down vote up
static boolean isPAYLOADMode(@NotNull Service.Mode mode) {
       return mode == Service.Mode.PAYLOAD;
}
 
Example #23
Source File: PacketDispatch.java    From jdk8u60 with GNU General Public License v2.0 4 votes vote down vote up
public PacketDispatch(WSPortInfo portInfo, BindingImpl binding, WSEndpointReference epr) {
    super(portInfo, Mode.MESSAGE, binding, epr, true);
    isDeliverThrowableInPacket = calculateIsDeliverThrowableInPacket(binding);
}
 
Example #24
Source File: SOAPSourceDispatch.java    From openjdk-jdk8u with GNU General Public License v2.0 4 votes vote down vote up
@Deprecated
public SOAPSourceDispatch(QName port, Mode mode, WSServiceDelegate owner, Tube pipe, BindingImpl binding, WSEndpointReference epr) {
    super(port, mode, owner, pipe, binding, epr);
    assert !isXMLHttp(binding);
}
 
Example #25
Source File: SOAPSourceDispatch.java    From openjdk-jdk8u with GNU General Public License v2.0 4 votes vote down vote up
public SOAPSourceDispatch(WSPortInfo portInfo, Mode mode, BindingImpl binding, WSEndpointReference epr) {
        super(portInfo, mode, binding, epr);
        assert !isXMLHttp(binding);
}
 
Example #26
Source File: RESTSourceDispatch.java    From openjdk-jdk8u with GNU General Public License v2.0 4 votes vote down vote up
@Deprecated
public RESTSourceDispatch(QName port, Mode mode, WSServiceDelegate owner, Tube pipe, BindingImpl binding, WSEndpointReference epr) {
    super(port, mode, owner, pipe, binding, epr);
    assert isXMLHttp(binding);
}
 
Example #27
Source File: PacketDispatch.java    From jdk8u60 with GNU General Public License v2.0 4 votes vote down vote up
@Deprecated
public PacketDispatch(QName port, WSServiceDelegate owner, Tube pipe, BindingImpl binding, @Nullable WSEndpointReference epr) {
    super(port, Mode.MESSAGE, owner, pipe, binding, epr);
    isDeliverThrowableInPacket = calculateIsDeliverThrowableInPacket(binding);
}
 
Example #28
Source File: DispatchImpl.java    From openjdk-jdk8u with GNU General Public License v2.0 4 votes vote down vote up
static boolean isPAYLOADMode(@NotNull Service.Mode mode) {
       return mode == Service.Mode.PAYLOAD;
}
 
Example #29
Source File: MessageDispatch.java    From openjdk-jdk8u with GNU General Public License v2.0 4 votes vote down vote up
public MessageDispatch(WSPortInfo portInfo, BindingImpl binding, WSEndpointReference epr) {
        super(portInfo, Mode.MESSAGE, binding, epr, true);
}
 
Example #30
Source File: PacketDispatch.java    From TencentKona-8 with GNU General Public License v2.0 4 votes vote down vote up
public PacketDispatch(WSPortInfo portInfo, BindingImpl binding, WSEndpointReference epr) {
    super(portInfo, Mode.MESSAGE, binding, epr, true);
    isDeliverThrowableInPacket = calculateIsDeliverThrowableInPacket(binding);
}