| |
|
| java.lang.Object javax.xml.ws.Service
Service | public class Service (Code) | | Service objects provide the client view of a Web service.
Service acts as a factory of the following:
- Proxies for a target service endpoint.
- Instances of
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.
since: JAX-WS 2.0 See Also: javax.xml.ws.spi.Provider See Also: javax.xml.ws.handler.HandlerResolver See Also: java.util.concurrent.Executor |
Inner Class :public enum Mode | |
create | public static Service create(java.net.URL wsdlDocumentLocation, QName serviceName)(Code) | | Create a Service instance.
The specified WSDL document location and service qualified name must
uniquely identify a wsdl:service element.
Parameters: wsdlDocumentLocation - URL for the WSDL document locationfor the service Parameters: serviceName - QName for the service throws: WebServiceException - If any error in creation of thespecified service |
create | public static Service create(QName serviceName)(Code) | | Create a Service instance.
Parameters: serviceName - QName for the service throws: WebServiceException - If any error in creation of thespecified service |
createDispatch | public Dispatch<T> createDispatch(QName portName, Class<T> type, Mode mode)(Code) | | Creates a Dispatch instance for use with objects of
the users choosing.
Parameters: portName - Qualified name for the target service endpoint Parameters: type - The class of object used to messages or messagepayloads. Implementations are required to supportjavax.xml.transform.Source , javax.xml.soap.SOAPMessage and javax.activation.DataSource , depending onthe binding in use. Parameters: mode - Controls whether the created dispatch instance is messageor payload oriented, i.e. whether the user will work with completeprotocol messages or message payloads. E.g. when using the SOAPprotocol, this parameter controls whether the user will work withSOAP messages or the contents of a SOAP body. Mode must be MESSAGEwhen type is SOAPMessage. Dispatch instance throws: WebServiceException - If any error in the creation ofthe Dispatch object See Also: javax.xml.transform.Source See Also: javax.xml.soap.SOAPMessage |
createDispatch | public Dispatch<Object> createDispatch(QName portName, JAXBContext context, Mode mode)(Code) | | Creates a Dispatch instance for use with JAXB
generated objects.
Parameters: portName - Qualified name for the target service endpoint Parameters: context - The JAXB context used to marshall and unmarshallmessages or message payloads. Parameters: mode - Controls whether the created dispatch instance is messageor payload oriented, i.e. whether the user will work with completeprotocol messages or message payloads. E.g. when using the SOAPprotocol, this parameter controls whether the user will work withSOAP messages or the contents of a SOAP body. Dispatch instance throws: ServiceException - If any error in the creation ofthe Dispatch object See Also: javax.xml.bind.JAXBContext |
getHandlerResolver | public HandlerResolver getHandlerResolver()(Code) | | Returns the configured handler resolver.
HandlerResolver The HandlerResolver beingused by this Service instance, or null if there isn't one. |
getPort | public T getPort(QName portName, Class<T> serviceEndpointInterface)(Code) | | The getPort method returns a stub. A service client
uses this stub to invoke operations on the target
service endpoint. The serviceEndpointInterface
specifies the service endpoint interface that is supported by
the created dynamic proxy or stub instance.
Parameters: portName - Qualified name of the service endpoint in the WSDL service description Parameters: serviceEndpointInterface - Service endpoint interface supported by the dynamic proxy or stubinstance Object Proxy instance that supports the specified service endpoint interface throws: WebServiceException - This exception is thrown in thefollowing cases:- If there is an error in creation of the proxy
- If there is any missing WSDL metadataas required by this method
- Optionally, if an illegal
serviceEndpointInterface or portName is specified See Also: java.lang.reflect.Proxy See Also: java.lang.reflect.InvocationHandler |
getPort | public T getPort(Class<T> serviceEndpointInterface)(Code) | | The getPort method returns a stub. The parameter
serviceEndpointInterface specifies the service
endpoint interface that is supported by the returned proxy.
In the implementation of this method, the JAX-WS
runtime system takes the responsibility of selecting a protocol
binding (and a port) and configuring the proxy accordingly.
The returned proxy should not be reconfigured by the client.
Parameters: serviceEndpointInterface - Service endpoint interface Object instance that supports the specified service endpoint interface throws: WebServiceException - - If there is an error during creationof the proxy
- If there is any missing WSDL metadataas required by this method
- Optionally, if an illegal
serviceEndpointInterface is specified |
getPorts | public Iterator<javax.xml.namespace.QName> getPorts()(Code) | | Returns an Iterator for the list of
QName s of service endpoints grouped by this
service
Returns java.util.Iterator with elementsof type javax.xml.namespace.QName throws: WebServiceException - If this Service class does nothave access to the required WSDL metadata |
getServiceName | public QName getServiceName()(Code) | | Gets the name of this service.
Qualified name of this service |
getWSDLDocumentLocation | public java.net.URL getWSDLDocumentLocation()(Code) | | Gets the location of the WSDL document for this Service.
URL for the location of the WSDL document for this service |
setExecutor | public void setExecutor(java.util.concurrent.Executor executor)(Code) | | Sets the executor for this Service instance.
The executor is used for all asynchronous invocations that
require callbacks.
Parameters: executor - The java.util.concurrent.Executor to be used to invoke a callback. throws: SecurityException - If the instance does not supportsetting an executor for security reasons (e.g. thenecessary permissions are missing). See Also: java.util.concurrent.Executor |
setHandlerResolver | public void setHandlerResolver(HandlerResolver handlerResolver)(Code) | | Sets the HandlerResolver for this Service
instance.
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.
Parameters: handlerResolver - The HandlerResolver to usefor all subsequently created proxy/dispatch objects. See Also: javax.xml.ws.handler.HandlerResolver |
|
|
|