weborb.client.WeborbClient Class API
Constructors:
public WeborbClient( String endpointURL ) where: endpointURL - is the endpoint URL of a WebORB server where the targeted service is deployed.
The constructor creates a basic instance of WeborbClient which will communicate with WebORB at the specified endpoint URL with GenericDestination and infinite 'response read' timeout. |
public WeborbClient( String endpointURL, int timeout ) where endpointURL - is the endpoint URL of a WebORB server where the targeted service is deployed. timeout - sets the read timeout (when expecting a response from the server) to the specified timeout, in milliseconds. A non-zero value specifies the timeout when reading server's response when a connection is established to WebORB. A timeout of zero is interpreted as an infinite timeout (this is the default setting).
The client will communicate with WebORB at the specified endpoint URL, will use GenericDestination and the specified 'response read' timeout. |
public WeborbClient( String endpointURL, String destination ) where endpointURL - is the endpoint URL of a WebORB server where the targeted service is deployed. destination - the name of a remoting destination the client will use in the invocation requests. The destination can be either a concrete with a service mapped to it or it can be the value of "GenericDestination".
The client will communicate with WebORB at the specified endpoint URL and will use the specified destination name. The 'response read' timeout is infinite. |
public WeborbClient( String endpointURL, String destination, int timeout ) where endpointURL - is the endpoint URL of a WebORB server where the targeted service is deployed. destination - the name of a remoting destination the client will use in the invocation requests. The destination can be either a concrete with a service mapped to it or it can be the value of "GenericDestination".
The client will communicate with WebORB at the specified endpoint URL, will use the specified destination and timeout values. |
Invocation Methods
public void invoke( String methodName, Object[] args, IResponder responder ) throws Exception where: methodName - the name of the method to invoke args - method arguments responder - responder object with references to the success and failure callback methods
The method sends an invocation request to the server designated with endpoint URL specified in the WeborbClient constructor. WebORB on the server side invokes the specified method on a service identified by the destination, which also must be specified in the WeborbClient constructor.
Example: WeborbClient client = new WeborbClient( "http://localhost:8080/weborb.wo", "MyServiceDestination" ); The example code invokes the ProcessOrder method with one argument (orderObject) on a service identified by the MyServiceDestination destination. |
public void invoke( String serviceID, String methodName, Object[] args, IResponder responder ) throws Exception where: serviceID - ID of a service to invoke the method on. Can be fully qualified class name, Spring bean ID, EJB's JNDI name, etc. methodName - the name of the method to invoke args - method arguments responder - responder object with references to the success and failure callback methods
The method sends an invocation request to the server designated with endpoint URL specified in the WeborbClient constructor. WebORB on the server side invokes the specified method on a service identified by the destination, which also must be specified in the WeborbClient constructor.
Example: WeborbClient client = new WeborbClient( "http://localhost:8080/weborb.wo", "GenericDestination" ); The example code invokes the DoSomething method with one argument (123) on the com.foo.MyService class. |