|
||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |
java.lang.Objectorg.systinet.wasp.webservice.ServiceClient
This class represents client side of a service which is being called. It represents WSDL service name & port name and/or message processing such as client handlers, interceptors etc. It's factory for invocation under WSDL - dynamic proxy and dynamic calls (DII). Other type of settings is pertained to attributes of invocation: service url, service iface, timeouts, asynchronous transport etc. Common usages are as following:
invocation via dynamic proxy ...ServiceClient client = ServiceClient.create("http://localhost:6060/HelloWorld/wsdl"); client.set...; MyService proxy = (MyService)client.createProxy(MyService.class); proxy.hello(...);invocation with dynamic call ...
ServiceClient client = ServiceClient.create("http://localhost:6060/HelloWorld/wsdl"); client.set...; WaspCall call = client.createCall("hello"); call.invoke(...);calling service with WSDL (or nonblocked send) with given SOAP message (see
WaspProviderConnection
) ...
ServiceClient client = ServiceClient.create("http://localhost:6060/HelloWorld/wsdl"); client.set...; SOAPMessage request = msgFactory.createMessage(); request... SOAPMessage response = connection.call(request, client);when the service doesn't have WSDL ...
ServiceClient client = ServiceClient.create(); client.setServiceURL("http://localhost:6060/HelloWorld"); ...
Constructor Summary | |
protected |
ServiceClient()
|
Method Summary | |
abstract void |
addListener(ServiceClientListener listener)
Adds service client listener. |
static ServiceClient |
create()
Creates new instance of ServiceClient. |
static ServiceClient |
create(java.lang.Class iface)
Deprecated. use create() and createProxy(java.lang.Class) instead |
static ServiceClient |
create(ServiceClient serviceClient)
Creates new instance of ServiceClient. |
static ServiceClient |
create(java.lang.String wsdlUrl)
Creates new instance of ServiceClient with WSDL from given URL. |
static ServiceClient |
create(java.lang.String wsdlUrl,
java.lang.Class iface)
Deprecated. use create(java.lang.String) and createProxy(java.lang.Class) instead |
static ServiceClient |
create(java.lang.String wsdlUrl,
java.lang.Class iface,
java.util.Map contextData)
Deprecated. use create(java.lang.String, java.util.Map) and createProxy(java.lang.Class) instead |
static ServiceClient |
create(java.lang.String wsdlUrl,
java.lang.Class iface,
ServiceClient serviceClient)
Deprecated. use create(org.systinet.wasp.webservice.ServiceClient) and createProxy(java.lang.Class) instead |
static ServiceClient |
create(java.lang.String wsdlUrl,
java.util.Map contextData)
Creates new instance of ServiceClient with WSDL from given URL. |
abstract WaspCall |
createCall()
Creates new dynamic call object for the port name of this service client WSDL. |
abstract WaspCall |
createCall(java.lang.String operation)
Creates new dynamic call object for given operation and port name of this service client WSDL. |
abstract java.lang.Object |
createProxy(java.lang.Class iface)
Creates new dynamic proxy object with given interface from the port of this service client WSDL. |
abstract java.lang.String |
getAsyncEndpointPath()
Retrieves the path of callback endpoint used during transport coupling. |
abstract int |
getAsyncTimeout()
Deprecated. use AsyncConversation.getTimeout() instead |
abstract java.lang.String |
getAsyncTransport()
Retrieves the name of asynchronous protocol used during transport coupling. |
abstract Attributes |
getAttributes()
Retrieves attributes store bound to this service instance. |
abstract CallContext |
getCallContext()
Gets call context associated with this service client calls. |
abstract Configurable |
getConfigurable()
Retrieves a custom configuration of the service client. |
abstract int |
getConnectionTimeout()
Deprecated. See CallContext.TRANSPORT_CONNECTION_TIMEOUT . |
abstract ServiceClientContext |
getContext()
Retrieves unique context for this service client. |
abstract java.lang.Class |
getInterface()
Deprecated. ServiceClient doesn't remember an interface for created proxy. See createProxy(java.lang.Class) . |
abstract java.lang.Object |
getProxy()
Deprecated. use createProxy(java.lang.Class) instead |
abstract java.lang.String |
getResource(java.lang.String path)
Returns the resource with the given name or null if the resource could not be found. |
abstract java.io.InputStream |
getResourceAsStream(java.lang.String path)
Returns an input stream for reading the specified resource or null if the resource could not be found. |
abstract java.lang.String |
getServiceURL()
Gets URL of service location used during service invocation. |
abstract Definition |
getWSDL()
Retrieves WSDL definition for this service client. |
abstract java.lang.String |
getWSDLLocation()
Retrieves URL of WSDL definition for called webservice. |
abstract java.lang.String |
getWSDLPortName()
Returns name of service port in WSDL definition. |
abstract QName |
getWSDLServiceName()
Returns name of service in WSDL. |
abstract void |
log(java.lang.String msg)
Logs a message. |
abstract void |
log(java.lang.String message,
java.lang.Throwable throwable)
Logs a message and exception. |
abstract void |
removeListener(ServiceClientListener listener)
Removes service client listener. |
abstract void |
setAsyncEndpointPath(java.lang.String path)
Sets the callback endpoint path for transport coupling. |
abstract void |
setAsyncTimeout(int timeout)
Deprecated. use AsyncConversation.setTimeout(long) instead |
abstract void |
setAsyncTransport(java.lang.String asyncTransport)
Sets the asynchronous protocol used during transport coupling. |
abstract void |
setConfigurable(Configurable serviceClientConfig)
Sets the configuration of the service client. |
abstract void |
setConnectionTimeout(int timeout)
Deprecated. See CallContext.TRANSPORT_CONNECTION_TIMEOUT . You can set
timeout for all invocations from this ServiceClient:
serviceClient.getContext().getContextData().put(CallContext.TRANSPORT_CONNECTION_TIMEOUT, new Integer(10000));or timeout for next invocation only: serviceClient.getCallContext().getContextData().put(CallContext.TRANSPORT_CONNECTION_TIMEOUT, new Integer(10000)); |
abstract void |
setInterface(java.lang.Class iface)
Deprecated. use createProxy(java.lang.Class) instead |
abstract void |
setServiceURL(java.lang.String url)
Sets service location. |
abstract void |
setWSDL(Definition wsdl)
Sets WSDL definition for this service client. |
abstract void |
setWSDLLocation(java.lang.String url)
Sets WSDL definition URL. |
abstract void |
setWSDLPortName(java.lang.String portName)
Sets name of service port in WSDL definition. |
abstract void |
setWSDLServiceName(QName serviceName)
Sets WSDL definition URL. |
abstract void |
unpublishAsyncEndpoint()
Unpublish callback endpoint if it is published. |
Methods inherited from class java.lang.Object |
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
Methods inherited from interface org.systinet.wasp.webservice.Processing |
getHandlers, getHeaderProcessors, getInterceptors |
Constructor Detail |
protected ServiceClient()
Method Detail |
public static ServiceClient create()
public static ServiceClient create(java.lang.String wsdlUrl)
wsdlUrl
- URL used for retrieving WSDL
public static ServiceClient create(java.lang.String wsdlUrl, java.util.Map contextData)
ServiceClientContext
and used during the lookup operation also.
wsdlUrl
- URL used for retrieving WSDLcontextData
- ServiceClientContext data for this ServiceClient
ServiceClientContext
public static ServiceClient create(ServiceClient serviceClient)
serviceClient
- source of other settings that are cloned to newly
created instance of ServiceClient.
public static ServiceClient create(java.lang.Class iface)
create()
and createProxy(java.lang.Class)
instead
iface
- service interface used during lookup process
public static ServiceClient create(java.lang.String wsdlUrl, java.lang.Class iface)
create(java.lang.String)
and createProxy(java.lang.Class)
instead
wsdlUrl
- WSDL URL used for lookup processiface
- service interface used during lookup process
public static ServiceClient create(java.lang.String wsdlUrl, java.lang.Class iface, java.util.Map contextData)
create(java.lang.String, java.util.Map)
and createProxy(java.lang.Class)
instead
ServiceClientContext
which is created during the lookup operation.
wsdlUrl
- WSDL URL used for lookup processiface
- service interface used during lookup processcontextData
- data used to configure the lookup operation and stub
ServiceClientContext
public static ServiceClient create(java.lang.String wsdlUrl, java.lang.Class iface, ServiceClient serviceClient)
create(org.systinet.wasp.webservice.ServiceClient)
and createProxy(java.lang.Class)
instead
wsdlUrl
- service url used during lookup processiface
- service interface used during lookup processserviceClient
- source of other settings that are cloned to newly
created instance of ServiceClient.
public abstract Configurable getConfigurable()
public abstract void setConfigurable(Configurable serviceClientConfig)
serviceClientConfig
- public abstract ServiceClientContext getContext()
public abstract CallContext getCallContext()
public abstract java.lang.String getAsyncTransport()
setAsyncTransport(java.lang.String)
this method returns null. After lookup,
async transport is the same as the transport used in service url defined
in service wsdl. Transport can be setup explicitly using setAsyncTransport(java.lang.String)
.
public abstract void setAsyncTransport(java.lang.String asyncTransport)
getAsyncTransport()
.
asyncTransport
- name of tranport used during transport couplingpublic abstract java.lang.String getAsyncEndpointPath()
public abstract void setAsyncEndpointPath(java.lang.String path)
getAsyncEndpointPath()
.
path
- of the asynchronous callback endpoint used during transport couplingpublic abstract void unpublishAsyncEndpoint() throws PublishException
setAsyncEndpointPath(java.lang.String)
method or automatically. If the endpoint isn�t published
method will return immediately.
PublishException
public abstract int getAsyncTimeout()
AsyncConversation.getTimeout()
instead
public abstract void setAsyncTimeout(int timeout)
AsyncConversation.setTimeout(long)
instead
timeout
- in millispublic abstract java.lang.String getResource(java.lang.String path)
null
if the resource could not be found.
The name of a resource is a "/"-separated path name that
identifies the resource.
For the path name "/" returns the location of the client-side
packages directory, if some client package for requested service exists.
path
- path of the resource
public abstract java.io.InputStream getResourceAsStream(java.lang.String path) throws java.io.IOException
null
if the resource could not be found.
path
- path of the resource
java.io.IOException
- if something goes wrongpublic abstract void log(java.lang.String msg)
msg
- message to be loggedpublic abstract void log(java.lang.String message, java.lang.Throwable throwable)
message
- the message to be loggedthrowable
- the exception to be loggedpublic abstract void setConnectionTimeout(int timeout)
CallContext.TRANSPORT_CONNECTION_TIMEOUT
. You can set
timeout for all invocations from this ServiceClient:
serviceClient.getContext().getContextData().put(CallContext.TRANSPORT_CONNECTION_TIMEOUT, new Integer(10000));or timeout for next invocation only:
serviceClient.getCallContext().getContextData().put(CallContext.TRANSPORT_CONNECTION_TIMEOUT, new Integer(10000));
timeout
is
negative connection will use its own default timeout.
timeout
- timeout in millis, 0
means no timeoutpublic abstract int getConnectionTimeout()
CallContext.TRANSPORT_CONNECTION_TIMEOUT
.
timeout
is
negative connection will use its own default timeout.
0
means no timeoutpublic abstract java.lang.Class getInterface()
createProxy(java.lang.Class)
.
public abstract void setInterface(java.lang.Class iface)
createProxy(java.lang.Class)
instead
iface
- service interfacepublic abstract java.lang.Object createProxy(java.lang.Class iface) throws LookupException
iface
- proxy interface
LookupException
- when an error occurs during lookuppublic abstract java.lang.Object getProxy()
createProxy(java.lang.Class)
instead
Registry.lookup(org.systinet.wasp.webservice.ServiceClient)
.
public abstract WaspCall createCall(java.lang.String operation) throws LookupException
operation
- operation name
LookupException
- when an error occurs during lookuppublic abstract WaspCall createCall() throws LookupException
Call.setOperationName(javax.xml.namespace.QName)
on the call instance.
LookupException
- when an error occurs during lookuppublic abstract Definition getWSDL() throws LookupException
null
LookupException
- when an error occurs during lookuppublic abstract void setWSDL(Definition wsdl)
WSDLReader.readWSDL(java.lang.String)
, for instance:
Definition myWSDL = WSDLFactory.newInstance().newWSDLReader().readWSDL(null, "...");
wsdl
- WSDL definition.public abstract java.lang.String getWSDLLocation()
public abstract void setWSDLLocation(java.lang.String url)
url
- WSDL definition URLpublic abstract QName getWSDLServiceName() throws LookupException
LookupException
- when an error occurs during lookuppublic abstract void setWSDLServiceName(QName serviceName)
serviceName
- name of service in WSDLpublic abstract java.lang.String getWSDLPortName() throws LookupException
LookupException
- when an error occurs during lookuppublic abstract void setWSDLPortName(java.lang.String portName)
portName
- name of service port in WSDLpublic abstract void setServiceURL(java.lang.String url)
url
- service urlpublic abstract java.lang.String getServiceURL() throws LookupException
LookupException
- when an error occurs during lookuppublic abstract Attributes getAttributes()
public abstract void addListener(ServiceClientListener listener)
listener
- listener to addpublic abstract void removeListener(ServiceClientListener listener)
listener
- listener to remove
|
||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |