Service objects provide the client view of a Web service.
Service acts as a factory of the following:
javax.xml.ws.Dispatch for
dynamic message-oriented invocation of a remote
operation.
The ports available on a service can be enumerated using the
getPorts method. Alternatively, you can pass a
service endpoint interface to the unary getPort method
and let the runtime select a compatible port.
Handler chains for all the objects created by a Service
can be set by means of a HandlerResolver.
An Executor may be set on the service in order
to gain better control over the threads used to dispatch asynchronous
callbacks. For instance, thread pooling with certain parameters
can be enabled by creating a ThreadPoolExecutor and
registering it with the service.
javax.xml.ws.spi.Provider, javax.xml.ws.handler.HandlerResolver, java.util.concurrent.Executor
| Modifier and Type | Class and Description |
|---|---|
| public static enum | Service.Mode
The orientation of a dynamic client or service. |
| Modifier and Type | Field and Description |
|---|---|
| private ServiceDelegate |
| Access | Constructor and Description |
|---|---|
| protected | |
| protected | Service(URL
URL for the WSDL document location
for the serviceQName for the serviceWeb Service features that must be configured on
the service. If the provider doesn't understand a feature,
it must throw a WebServiceException. features)Creates a |
| Modifier and Type | Method and Description |
|---|---|
| public void | |
| public static Service | |
| public static Service | Returns: Service instance configured with requested web service featuresURL for the WSDL document location
for the serviceQName for the serviceWeb Service features that must be configured on
the service. If the provider doesn't understand a feature,
it must throw a WebServiceException. features)Creates a |
| public static Service | |
| public static Service | Returns: Service instance configured with requested web service featuresQName for the serviceWeb Service features that must be configured on
the service. If the provider doesn't understand a feature,
it must throw a WebServiceException. features)Creates a |
| public < The type of the message or payload T> Dispatch | Returns: Dispatch instance.Qualified name for the target service endpoint portName, Class<T> The class of object used for messages or message
payloads. Implementations are required to support
type, Service.javax.xml.transform.Source, javax.xml.soap.SOAPMessage
and javax.activation.DataSource, depending on
the binding in use.Controls whether the created dispatch instance is message
or payload oriented, i.e. whether the client will work with complete
protocol messages or message payloads. E.g. when using the SOAP
protocol, this parameter controls whether the client will work with
SOAP messages or the contents of a SOAP body. Mode MUST be MESSAGE
when type is SOAPMessage. modeCreates a |
| public < The type of the message or payload T> Dispatch | Returns: Dispatch instance.Qualified name for the target service endpoint portName, Class<T> The class of object used for messages or message
payloads. Implementations are required to support
type, Service.javax.xml.transform.Source and javax.xml.soap.SOAPMessage.Controls whether the created dispatch instance is message
or payload oriented, i.e. whether the client will work with complete
protocol messages or message payloads. E.g. when using the SOAP
protocol, this parameter controls whether the client will work with
SOAP messages or the contents of a SOAP body. Mode MUST be mode,MESSAGE
when type is SOAPMessage.A list of features)WebServiceFeatures to configure on the
proxy. Supported features not in the features
parameter will have their default values.Creates a |
| public < The type of the message or payload T> Dispatch | Returns: Dispatch instanceThe endpointReference, Class<T> EndpointReference
for the target service endpoint that will be invoked by the
returned Dispatch object.The class of object used to messages or message
payloads. Implementations are required to support
type, Service.javax.xml.transform.Source and javax.xml.soap.SOAPMessage.Controls whether the created dispatch instance is message
or payload oriented, i.e. whether the client will work with complete
protocol messages or message payloads. E.g. when using the SOAP
protocol, this parameter controls whether the client will work with
SOAP messages or the contents of a SOAP body. Mode MUST be mode,MESSAGE
when type is SOAPMessage.An array of features)WebServiceFeatures to configure on the
proxy. Supported features not in the features
parameter will have their default values.Creates a |
| public Dispatch | Returns: Dispatch instance.Qualified name for the target service endpoint portName, JAXBContext The JAXB context used to marshall and unmarshall
messages or message payloads. context, Service.Controls whether the created dispatch instance is message
or payload oriented, i.e. whether the client will work with complete
protocol messages or message payloads. E.g. when using the SOAP
protocol, this parameter controls whether the client will work with
SOAP messages or the contents of a SOAP body. modeCreates a |
| public Dispatch | Returns: Dispatch instance.Qualified name for the target service endpoint portName, JAXBContext The JAXB context used to marshall and unmarshall
messages or message payloads. context, Service.Controls whether the created dispatch instance is message
or payload oriented, i.e. whether the client will work with complete
protocol messages or message payloads. E.g. when using the SOAP
protocol, this parameter controls whether the client will work with
SOAP messages or the contents of a SOAP body. mode,A list of features)WebServiceFeatures to configure on the
proxy. Supported features not in the features
parameter will have their default values.Creates a |
| public Dispatch | Returns: Dispatch instanceThe endpointReference, JAXBContext EndpointReference
for the target service endpoint that will be invoked by the
returned Dispatch object.The JAXB context used to marshall and unmarshall
messages or message payloads. context, Service.Controls whether the created dispatch instance is message
or payload oriented, i.e. whether the client will work with complete
protocol messages or message payloads. E.g. when using the SOAP
protocol, this parameter controls whether the client will work with
SOAP messages or the contents of a SOAP body. mode,An array of features)WebServiceFeatures to configure on the
proxy. Supported features not in the features
parameter will have their default values.Creates a |
| public Executor | Returns: Thejava.util.concurrent.Executor to be
used to invoke a callback.Returns the executor for this |
| public HandlerResolver | Returns: HandlerResolver TheHandlerResolver being
used by this Service instance, or null
if there isn't one.Returns the configured handler resolver. |
| public < Service endpoint interface. T> T | Returns: Object Proxy instance that supports the specified service endpoint interface.Qualified name of the service endpoint in
the WSDL service description. portName, Class<T> Service endpoint interface
supported by the dynamic proxy instance. serviceEndpointInterface)The |
| public < Service endpoint interface. T> T | Returns: Object Proxy instance that supports the specified service endpoint interface.Qualified name of the service endpoint in
the WSDL service description. portName, Class<T> Service endpoint interface
supported by the dynamic proxy instance. serviceEndpointInterface, WebServiceFeature... A list of WebServiceFeatures to configure on the
proxy. Supported features not in the features)features
parameter will have their default values.The |
| public < Service endpoint interface. T> T | |
| public < Service endpoint interface. T> T | Returns: Object instance that supports the specified service endpoint interface.Service endpoint interface. serviceEndpointInterface, WebServiceFeature... A list of WebServiceFeatures to configure on the
proxy. Supported features not in the features)features
parameter will have their default values.The |
| public < Service endpoint interface. T> T | Returns: Object Proxy instance that supports the specified service endpoint interface.The endpointReference, Class<T> EndpointReference
for the target service endpoint that will be invoked by the
returned proxy.Service endpoint interface. serviceEndpointInterface, WebServiceFeature... A list of features)WebServiceFeatures to configure on the
proxy. Supported features not in the features
parameter will have their default values.The |
| public Iterator | Returns: Returnsjava.util.Iterator with elements
of type javax.xml.namespace.QName.Returns an |
| public QName | |
| public URL | Returns: URL for the location of the WSDL document for this service.Gets the location of the WSDL document for this Service. |
| public void | setExecutor(Executor
The executor)java.util.concurrent.Executor
to be used to invoke a callback.Sets the executor for this |
| public void | setHandlerResolver(HandlerResolver
The handlerResolver)HandlerResolver to use
for all subsequently created proxy/dispatch objects.Sets the |
| delegate | back to summary |
|---|---|
| private ServiceDelegate delegate | |
| Service | back to summary |
|---|---|
| protected Service(URL wsdlDocumentLocation, QName serviceName) Creates a | |
| Service | back to summary |
|---|---|
| protected Service(URL wsdlDocumentLocation, QName serviceName, WebServiceFeature... features) Creates a
| |
| addPort | back to summary |
|---|---|
| public void addPort(QName portName, String bindingId, String endpointAddress) Creates a new port for the service. Ports created in this way contain
no WSDL port type information and can only be used for creating
| |
| create | back to summary |
|---|---|
| public static Service create(URL wsdlDocumentLocation, QName serviceName) Creates a
| |
| create | back to summary |
|---|---|
| public static Service create(URL wsdlDocumentLocation, QName serviceName, WebServiceFeature... features) Creates a
| |
| create | back to summary |
|---|---|
| public static Service create(QName serviceName) Creates a
| |
| create | back to summary |
|---|---|
| public static Service create(QName serviceName, WebServiceFeature... features) Creates a
| |
| createDispatch | back to summary |
|---|---|
| public <T> Dispatch Creates a
| |
| createDispatch | back to summary |
|---|---|
| public <T> Dispatch Creates a
| |
| createDispatch | back to summary |
|---|---|
| public <T> Dispatch Creates a This method behaves the same as calling
where the portName is retrieved from the
WSDL or EndpointReference metadata.
| |
| createDispatch | back to summary |
|---|---|
| public Dispatch Creates a
| |
| createDispatch | back to summary |
|---|---|
| public Dispatch Creates a
| |
| createDispatch | back to summary |
|---|---|
| public Dispatch Creates a This method behavies the same as calling
where the portName is retrieved from the
WSDL or endpointReference metadata.
| |
| getExecutor | back to summary |
|---|---|
| public Executor getExecutor() Returns the executor for this
| |
| getHandlerResolver | back to summary |
|---|---|
| public HandlerResolver getHandlerResolver() Returns the configured handler resolver.
| |
| getPort | back to summary |
|---|---|
| public <T> T getPort(QName portName, Class<T> serviceEndpointInterface) The
| |
| getPort | back to summary |
|---|---|
| public <T> T getPort(QName portName, Class<T> serviceEndpointInterface, WebServiceFeature... features) The
| |
| getPort | back to summary |
|---|---|
| public <T> T getPort(Class<T> serviceEndpointInterface) The
| |
| getPort | back to summary |
|---|---|
| public <T> T getPort(Class<T> serviceEndpointInterface, WebServiceFeature... features) The
| |
| getPort | back to summary |
|---|---|
| public <T> T getPort(EndpointReference endpointReference, Class<T> serviceEndpointInterface, WebServiceFeature... features) The Calling this method has the same behavior as the following
where the portName is retrieved from the
metadata of the endpointReference or from the
serviceEndpointInterface and the WSDL
associated with this Service instance.
| |
| getPorts | back to summary |
|---|---|
| public Iterator Returns an
| |
| getServiceName | back to summary |
|---|---|
| public QName getServiceName() Gets the name of this service.
| |
| getWSDLDocumentLocation | back to summary |
|---|---|
| public URL getWSDLDocumentLocation() Gets the location of the WSDL document for this Service.
| |
| setExecutor | back to summary |
|---|---|
| public void setExecutor(Executor executor) Sets the executor for this
| |
| setHandlerResolver | back to summary |
|---|---|
| public void setHandlerResolver(HandlerResolver handlerResolver) Sets the The handler resolver, if present, will be called once for each proxy or dispatch instance that is created, and the handler chain returned by the resolver will be set on the instance.
| |
MESSAGE provides
access to entire protocol message, PAYLOAD to protocol message
payload only.
| Modifier and Type | Field and Description |
|---|---|
| public static final Service. | MESSAGE
Message mode. |
| public static final Service. | PAYLOAD
Payload mode. |
| Access | Constructor and Description |
|---|---|
| private |
| Modifier and Type | Method and Description |
|---|---|
| public static Service. | |
| public static Service. |
| MESSAGE | back to summary |
|---|---|
| public static final Service. Message mode. | |
| PAYLOAD | back to summary |
|---|---|
| public static final Service. Payload mode. | |
| Mode | back to summary |
|---|---|
| private Mode() | |
| valueOf | back to summary |
|---|---|
| public static Service. | |
| values | back to summary |
|---|---|
| public static Service. | |