org.systinet.wasp.rpc
Interface WaspCall

All Superinterfaces:
Call

public interface WaspCall
extends Call

WaspCall is an extension of javax.xml.rpc.Call offering mainly the API for asynchronous invocations. This class can be instantiated by following ways:

  import javax.xml.rpc.ServiceFactory;
  import javax.xml.rpc.Service;

  ...
  ServiceFactory factory = ServiceFactory.newInstance();
  Service service = factory.createService(new URL("http://localhost:6060/HelloWorld"),
               new QName("http://my.org","HelloWorldService"));
  WaspCall waspCall = (WaspCall)service.createCall(new QName("http://my.org","getHello"));
  ...
 
or
   import org.systinet.wasp.webservice.ServiceClient;
   ...
   ServiceClient sc = ServiceClient.create("http://localhost:6060/HelloWorld");
   WaspCall call = sc.createCall("getHello");
   ...

 
The latter way is suitable, when you need further, WSO2 SOA Enablement Server specific configuration of client side(f.e. interceptors etc)

Component:
Core

Field Summary
static java.lang.String UNWRAPPED_PROPERTY
          Instruct invocation framework how to parse WSDL.
 
Fields inherited from interface javax.xml.rpc.Call
ENCODINGSTYLE_URI_PROPERTY, OPERATION_STYLE_PROPERTY, PASSWORD_PROPERTY, SESSION_MAINTAIN_PROPERTY, SOAPACTION_URI_PROPERTY, SOAPACTION_USE_PROPERTY, USERNAME_PROPERTY
 
Method Summary
 AsyncConversation beginInvoke(java.lang.Object[] inputParams)
          Starts asynchronous communication using supplied parameters.
 AsyncConversation beginInvoke(QName operationName, java.lang.Object[] inputParams)
          Starts asynchronous communication using supplied parameters for invocation of given service operation.
 java.lang.Object endInvoke(AsyncConversation asyncResult)
          Finishes asynchronous communication, identified by given AsyncConversation.
 java.util.Map getOutputParams(AsyncConversation asyncResult)
          This method works the same way as getOutputValues(AsyncConversation async), except it returns key-value pairs of out parameters and their current values.
 java.util.List getOutputValues(AsyncConversation asyncResult)
          This method retrieves a list of all out values received in asynchronous communication identified by given AsyncConversation.
 void release()
          This method is for optimization purposes.
 
Methods inherited from interface javax.xml.rpc.Call
addParameter, addParameter, getOperationName, getOutputParams, getOutputValues, getParameterTypeByName, getPortTypeName, getProperty, getPropertyNames, getReturnType, getTargetEndpointAddress, invoke, invoke, invokeOneWay, isParameterAndReturnSpecRequired, removeAllParameters, removeProperty, setOperationName, setPortTypeName, setProperty, setReturnType, setReturnType, setTargetEndpointAddress
 

Field Detail

UNWRAPPED_PROPERTY

public static final java.lang.String UNWRAPPED_PROPERTY
Instruct invocation framework how to parse WSDL. If you wan to unwrap elements in WSDL set this property to Boolean.TRUE, else set it to Boolean.FALSE. If not specified, default value from configuration is used.

See Also:
Constant Field Values
Method Detail

beginInvoke

public AsyncConversation beginInvoke(java.lang.Object[] inputParams)
                              throws java.rmi.RemoteException
Starts asynchronous communication using supplied parameters. Operation to be invoked on service must be specified using Call.setOperationName(javax.xml.namespace.QName). This method is non-blocking. Returns AsyncConversation, which acts as a handle to this communication. For further details about AsyncConversation class see AsyncConversation.

Parameters:
inputParams - parameters of operation
Returns:
AsyncConversation handle of started communication
Throws:
java.rmi.RemoteException - when any exception occures during communication with service

beginInvoke

public AsyncConversation beginInvoke(QName operationName,
                                     java.lang.Object[] inputParams)
                              throws java.rmi.RemoteException
Starts asynchronous communication using supplied parameters for invocation of given service operation. This method is non-blocking. Returns AsyncConversation, which acts as a handle to this communication. For further details about AsyncConversation class see AsyncConversation.

Parameters:
operationName - operation to be invoked
inputParams - parameters of operation
Returns:
AsyncConversation handle of started communication
Throws:
java.rmi.RemoteException - when any exception occures during communication with service

endInvoke

public java.lang.Object endInvoke(AsyncConversation asyncResult)
                           throws java.rmi.RemoteException
Finishes asynchronous communication, identified by given AsyncConversation. This method blocks until response is ready. Usual invocation is from within AsyncCallback.onResponse(org.systinet.wasp.async.AsyncConversation), however it is possible to call this method directly. It retuns return value of the method or null. Out and in/out parameters can be read by getOutputParams(AsyncConversation result) or getOutputValues(AsyncConversation result)

Parameters:
asyncResult - handle to asynchronous invocation
Returns:
return value of the method
Throws:
java.rmi.RemoteException - when any exception occures during service invocation.
TimeoutException - when timeout of AsyncConversation occures. See AsyncConversation.setTimeout(long).

getOutputValues

public java.util.List getOutputValues(AsyncConversation asyncResult)
                               throws java.rmi.RemoteException
This method retrieves a list of all out values received in asynchronous communication identified by given AsyncConversation. Note that out parameters are filled during response processing so it MUST be called after endInvoke(org.systinet.wasp.async.AsyncConversation) to retrieve valid data.

Parameters:
asyncResult - handle to asynchronous invocation
Returns:
List of out values
Throws:
java.rmi.RemoteException - when any exception occures during service invocation.

getOutputParams

public java.util.Map getOutputParams(AsyncConversation asyncResult)
                              throws java.rmi.RemoteException
This method works the same way as getOutputValues(AsyncConversation async), except it returns key-value pairs of out parameters and their current values.

Parameters:
asyncResult - handle to asynchronous invocation
Returns:
Map of key-value pairs of out parameters and their values
Throws:
java.rmi.RemoteException - when any exception occures during service invocation.

release

public void release()
This method is for optimization purposes. Call this method for force release of resources held by given instance. If this method is not called, resources are cleaned during garbage collection.