org.apache.axis2.clientapi
Class InOutMEPClient

java.lang.Object
  extended byorg.apache.axis2.clientapi.MEPClient
      extended byorg.apache.axis2.clientapi.InOutMEPClient
Direct Known Subclasses:
Call

public class InOutMEPClient
extends MEPClient

This Class capture handling the In-Out type Method invocations. this provides the methods to do blocking and non blocking invocation. The basic API is based on the MessageContext and the more convients API is provided by the Call


Nested Class Summary
 class InOutMEPClient.SyncCallBack
          This Class act as the Callback that allow users to wait on the result
 
Field Summary
protected  CallbackReceiver callbackReceiver
          This is used for the Receiving the Async Messages
protected  TransportListener listener
           
protected  TransportInDescription listenerTransport
           
protected  TransportOutDescription senderTransport
          transport that should be used for sending and reciving the message
protected  long timeOutInMilliSeconds
           
protected  EndpointReference to
          The address the message should be send
protected  boolean useSeparateListener
          Should the two SOAPMessage are sent over same channel over seperate channels.
 
Fields inherited from class org.apache.axis2.clientapi.MEPClient
doREST, doRestThroughPOST, isExceptionToBeThrownOnSOAPFault, mep, serviceContext, soapAction, soapVersionURI, wsaAction
 
Constructor Summary
InOutMEPClient(ServiceContext serviceContext)
          This accepts a ServiceContext, and the ServiceContext should have all the parents set in to it right Ideall this should be generated from a WSDL, we do not have it yet.
 
Method Summary
 void close()
          Closing the Call, this will stop the started Transport Listeners.
 MessageContext invokeBlocking(OperationDescription axisop, MessageContext msgctx)
          This invocation done via this method blocks till the result arrives, using this method does not indicate anyhting about the transport used or the nature of the transport.
 void invokeNonBlocking(OperationDescription axisop, MessageContext msgctx, Callback callback)
          This invocation done via this method blocks till the result arrives, using this method does not indicate anyhting about the transport used or the nature of the transport.
 void setTimeOutInMilliSeconds(long timeOutInMilliSeconds)
          This will be used in invoke blocking scenario.
 void setTo(EndpointReference to)
           
 void setTransportInfo(java.lang.String senderTransport, java.lang.String listenerTransport, boolean useSeparateListener)
          Set transport information to the the Call, for find how the each parameter acts see the commant at the instance variables.
 
Methods inherited from class org.apache.axis2.clientapi.MEPClient
createDefaultSOAPEnvelope, engageModule, getSoapAction, inferTransport, prepareInvocation, prepareTheSOAPEnvelope, setDoREST, setExceptionToBeThrownOnSOAPFault, setRestThroughPOST, setSoapAction, setSoapVersionURI, setWsaAction
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Field Detail

timeOutInMilliSeconds

protected long timeOutInMilliSeconds

listener

protected TransportListener listener

senderTransport

protected TransportOutDescription senderTransport
transport that should be used for sending and reciving the message


listenerTransport

protected TransportInDescription listenerTransport

useSeparateListener

protected boolean useSeparateListener
Should the two SOAPMessage are sent over same channel over seperate channels. The value of this variable depends on the transport specified. e.g. If the transports are different this is true by default. HTTP transport support both cases SMTP transport support only two channel case


to

protected EndpointReference to
The address the message should be send


callbackReceiver

protected CallbackReceiver callbackReceiver
This is used for the Receiving the Async Messages

Constructor Detail

InOutMEPClient

public InOutMEPClient(ServiceContext serviceContext)
This accepts a ServiceContext, and the ServiceContext should have all the parents set in to it right Ideall this should be generated from a WSDL, we do not have it yet.

Follwoing code works for the time been ConfigurationContextFactory efac = new ConfigurationContextFactory(); ConfigurationContext sysContext = efac.buildClientConfigurationContext(null); // above line "null" may be a file name if you know the client repssitory

//create new service QName assumedServiceName = new QName("Your Service"); ServiceDescription axisService = new ServiceDescription(assumedServiceName); sysContext.getEngineConfig().addService(axisService); ServiceContext service = sysContext.createServiceContext(assumedServiceName); return service;

Parameters:
serviceContext -
Method Detail

invokeBlocking

public MessageContext invokeBlocking(OperationDescription axisop,
                                     MessageContext msgctx)
                              throws AxisFault
This invocation done via this method blocks till the result arrives, using this method does not indicate anyhting about the transport used or the nature of the transport. e.g. invocation done with this method might
  1. send request via http and recevie the response via the return path of the same http connection
  2. send request via http and recevie the response different http connection
  3. send request via a email smtp and recevie the response via a email

Throws:
AxisFault

invokeNonBlocking

public void invokeNonBlocking(OperationDescription axisop,
                              MessageContext msgctx,
                              Callback callback)
                       throws AxisFault
This invocation done via this method blocks till the result arrives, using this method does not indicate anyhting about the transport used or the nature of the transport.

Throws:
AxisFault

setTo

public void setTo(EndpointReference to)
Parameters:
to -

setTransportInfo

public void setTransportInfo(java.lang.String senderTransport,
                             java.lang.String listenerTransport,
                             boolean useSeparateListener)
                      throws AxisFault
Set transport information to the the Call, for find how the each parameter acts see the commant at the instance variables. The senarios supoorted are as follows. [senderTransport, listenerTransport, useSeparateListener] http, http, true http, http, false http,smtp,true smtp,http,true smtp,smtp,true

Parameters:
senderTransport -
listenerTransport -
useSeparateListener -
Throws:
AxisFault

close

public void close()
           throws AxisFault
Closing the Call, this will stop the started Transport Listeners. If there are multiple request to send the Call should be kept open closing only when done

Throws:
AxisFault

setTimeOutInMilliSeconds

public void setTimeOutInMilliSeconds(long timeOutInMilliSeconds)
This will be used in invoke blocking scenario. Client will wait the amount of time specified here and if there is no response, call will timeout. This should be given in multiples of 100 and defaults to 2000.

Parameters:
timeOutInMilliSeconds -