本文整理匯總了Java中javax.xml.ws.Service.Mode方法的典型用法代碼示例。如果您正苦於以下問題:Java Service.Mode方法的具體用法?Java Service.Mode怎麽用?Java Service.Mode使用的例子?那麽, 這裏精選的方法代碼示例或許可以為您提供幫助。您也可以進一步了解該方法所在類javax.xml.ws.Service
的用法示例。
在下文中一共展示了Service.Mode方法的15個代碼示例,這些例子默認根據受歡迎程度排序。您可以為喜歡或者感覺有用的代碼點讚,您的評價將有助於係統推薦出更棒的Java代碼示例。
示例1: createDispatch
import javax.xml.ws.Service; //導入方法依賴的package包/類
public <T> Dispatch<T> createDispatch(QName portName, Class<T> aClass, Service.Mode mode, WebServiceFeatureList features) {
WSEndpointReference wsepr = null;
boolean isAddressingEnabled = false;
AddressingFeature af = features.get(AddressingFeature.class);
if (af == null) {
af = this.features.get(AddressingFeature.class);
}
if (af != null && af.isEnabled())
isAddressingEnabled = true;
MemberSubmissionAddressingFeature msa = features.get(MemberSubmissionAddressingFeature.class);
if (msa == null) {
msa = this.features.get(MemberSubmissionAddressingFeature.class);
}
if (msa != null && msa.isEnabled())
isAddressingEnabled = true;
if(isAddressingEnabled && wsdlService != null && wsdlService.get(portName) != null) {
wsepr = wsdlService.get(portName).getEPR();
}
return createDispatch(portName, wsepr, aClass, mode, features);
}
示例2: createDispatch
import javax.xml.ws.Service; //導入方法依賴的package包/類
/**
* 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());
}
示例3: checkValidSOAPMessageDispatch
import javax.xml.ws.Service; //導入方法依賴的package包/類
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()));
}
示例4: SOAPMessageDispatch
import javax.xml.ws.Service; //導入方法依賴的package包/類
public SOAPMessageDispatch(WSPortInfo portInfo, Service.Mode mode, BindingImpl binding, WSEndpointReference epr) {
super(portInfo, mode, binding, epr);
}
示例5: createDispatch
import javax.xml.ws.Service; //導入方法依賴的package包/類
public Dispatch<Object> createDispatch(EndpointReference endpointReference, JAXBContext context, Service.Mode mode, WebServiceFeature... features) {
WSEndpointReference wsepr = new WSEndpointReference(endpointReference);
QName portName = addPortEpr(wsepr);
return createDispatch(portName, wsepr, context, mode, features);
}
示例6: DataSourceDispatch
import javax.xml.ws.Service; //導入方法依賴的package包/類
public DataSourceDispatch(WSPortInfo portInfo, Service.Mode mode,BindingImpl binding, WSEndpointReference epr) {
super(portInfo, mode, binding, epr );
}
示例7: DataSourceDispatch
import javax.xml.ws.Service; //導入方法依賴的package包/類
@Deprecated
public DataSourceDispatch(QName port, Service.Mode mode, WSServiceDelegate service, Tube pipe, BindingImpl binding, WSEndpointReference epr) {
super(port, mode, service, pipe, binding, epr );
}
示例8: createDataSourceDispatch
import javax.xml.ws.Service; //導入方法依賴的package包/類
/**
* Creates a new {@link Dispatch} stub for {@link DataSource}.
*
* This is short-cut of calling
* <pre>
* createDispatch(port,owner,binding,DataSource.class,mode,next);
* </pre>
*/
@Deprecated
public static Dispatch<DataSource> createDataSourceDispatch(QName portName, WSService owner, WSBinding binding, Service.Mode mode, Tube next, @Nullable WSEndpointReference epr) {
DispatchImpl.checkValidDataSourceDispatch(binding, mode);
return new DataSourceDispatch(portName, mode, (WSServiceDelegate)owner, next, (BindingImpl)binding, epr);
}
示例9: createDispatch
import javax.xml.ws.Service; //導入方法依賴的package包/類
/**
* Creates a <code>Dispatch</code> instance for use with JAXB
* generated objects.
*
* @param portName Qualified name for the target service endpoint
* @param context The JAXB context used to marshall and unmarshall
* messages or message payloads.
* @param mode Controls whether the created dispatch instance is message
* or payload oriented, i.e. whether the user will work with complete
* protocol messages or message payloads. E.g. when using the SOAP
* protocol, this parameter controls whether the user will work with
* SOAP messages or the contents of a SOAP body.
* @param features A list of <code>WebServiceFeatures</code> to configure on the
* proxy. Supported features not in the <code>features
* </code> parameter will have their default values.
*
* @return Dispatch instance
* @throws WebServiceException If any error in the creation of
* the <code>Dispatch</code> object or if a
* feature is enabled that is not compatible with
* this port or is unsupported.
*
* @see javax.xml.bind.JAXBContext
* @see WebServiceFeature
*
* @since JAX-WS 2.1
**/
public abstract Dispatch<Object> createDispatch(QName portName,
JAXBContext context, Service.Mode mode, WebServiceFeature... features);
示例10: createSAAJDispatch
import javax.xml.ws.Service; //導入方法依賴的package包/類
/**
* Creates a new {@link Dispatch} stub for {@link SOAPMessage}.
*
* This is short-cut of calling
* <pre>
* createDispatch(port,owner,binding,SOAPMessage.class,mode,next);
* </pre>
*/
public static Dispatch<SOAPMessage> createSAAJDispatch(WSPortInfo portInfo, WSBinding binding, Service.Mode mode, @Nullable WSEndpointReference epr) {
DispatchImpl.checkValidSOAPMessageDispatch(binding, mode);
return new com.sun.xml.internal.ws.client.dispatch.SOAPMessageDispatch(portInfo, mode, (BindingImpl)binding, epr);
}
示例11: DispatchImpl
import javax.xml.ws.Service; //導入方法依賴的package包/類
/**
* @param portInfo dispatch instance is associated with this portInfo
* @param mode Service.mode associated with this Dispatch instance - Service.mode.MESSAGE or Service.mode.PAYLOAD
* @param binding Binding of this Dispatch instance, current one of SOAP/HTTP or XML/HTTP
*/
protected DispatchImpl(WSPortInfo portInfo, Service.Mode mode, BindingImpl binding, @Nullable WSEndpointReference epr) {
this(portInfo, mode, binding, epr, false);
}
示例12: createSourceDispatch
import javax.xml.ws.Service; //導入方法依賴的package包/類
/**
* Creates a new {@link Dispatch} stub for {@link Source}.
*
* This is short-cut of calling
* <pre>
* createDispatch(port,owner,binding,Source.class,mode,next);
* </pre>
*/
public static Dispatch<Source> createSourceDispatch(WSPortInfo portInfo, WSBinding binding, Service.Mode mode, @Nullable WSEndpointReference epr) {
return DispatchImpl.createSourceDispatch(portInfo, mode, (BindingImpl)binding, epr);
}
示例13: getServiceMode
import javax.xml.ws.Service; //導入方法依賴的package包/類
/**
* Is it PAYLOAD or MESSAGE ??
*
* @param c endpoint class
* @return Service.Mode.PAYLOAD or Service.Mode.MESSAGE
*/
private static Service.Mode getServiceMode(Class<?> c) {
ServiceMode mode = c.getAnnotation(ServiceMode.class);
return (mode == null) ? Service.Mode.PAYLOAD : mode.value();
}
示例14: createDispatch
import javax.xml.ws.Service; //導入方法依賴的package包/類
/**
* Works like {@link #createDispatch(javax.xml.ws.EndpointReference, javax.xml.bind.JAXBContext, javax.xml.ws.Service.Mode, javax.xml.ws.WebServiceFeature[])}
* but it takes the port name separately, so that EPR without embedded metadata can be used.
*/
public abstract Dispatch<Object> createDispatch(QName portName, WSEndpointReference wsepr, JAXBContext jaxbContext, Service.Mode mode, WebServiceFeature... features);
示例15: createDispatch
import javax.xml.ws.Service; //導入方法依賴的package包/類
/**
* Creates a {@code Dispatch} instance for use with objects of
* the user's choosing.
*
* @param <T> type used for messages or message payloads. Implementations are required to
* support {@code javax.xml.transform.Source} and {@code javax.xml.soap.SOAPMessage}.
* @param portName Qualified name for the target service endpoint
* @param type The class of object used for messages or message
* payloads. Implementations are required to support
* {@code javax.xml.transform.Source} and {@code javax.xml.soap.SOAPMessage}.
* @param mode Controls whether the created dispatch instance is message
* or payload oriented, i.e. whether the user will work with complete
* protocol messages or message payloads. E.g. when using the SOAP
* protocol, this parameter controls whether the user will work with
* SOAP messages or the contents of a SOAP body. Mode MUST be {@code MESSAGE}
* when type is {@code SOAPMessage}.
*
* @return Dispatch instance
* @throws WebServiceException If any error in the creation of
* the {@code Dispatch} object
* @see javax.xml.transform.Source
* @see javax.xml.soap.SOAPMessage
**/
public abstract <T> Dispatch<T> createDispatch(QName portName, Class<T> type,
Service.Mode mode);