Client Side API

Client Side Architecture

http://apache.org/~deepal/images/clientaci.PNG

What we provide

API for the Client

The API provided for the client is mainly by the Call. Followings are the methods that the call will provide initially.

public class Call{

public void setTo(ERP);
public void setAction(String);

public void setListenerTransport(String , boolean blocked);

public void send(SOAPEnvelope); 
public void sendAsync(SOAPEnvelope);
        
public SOAPEnvelope  sendReceive(SOAPEnvelope);
public void sendReceiveAsync(SOAPEnvelope, Callback);
}

public interface Callback{ 
void onComplete(AsyncResult);
}

public class AyncResult{
SOAPEnvelope getResponseEnvelope();
}

public class Correlator{
public void addCorrelationInfo(MessageID, Callback);
public Callback getCorrelationInfo(MessageID);
}

Possible Message Paths

sendAsync Invocation

The service invocation is a void invocation. No return value. (Fire and Forget)

a -> call.sendAsync(SOAPEnvelope)
b -> engine.send( ..)
c -> Send the SOAP message

//Asume that the transport is one way e.g. SMTP

Code Snippet:

call.setTargetURL(URL)
call.setAction(String)
call.sendAsync(SOAPEnvelope)

send Invocation

The service invocation is a void invocation. No return value, But wait for ack or SOAP Fault.

a -> call.send(SOAPEnvelope)
b -> engine.send( ..)
c -> Send the SOAP message

//Asume that the transport is one way e.g. SMTP

Code Snippet:

call.setTargetURL(URL)
call.setAction(String)
call.send(SOAPEnvelope)

sendReceive Invocation

The service method has a response and the communication happens synchronously using a bi-directional protocol. Client hangs until the response (or fault) is returned.

a -> call.sendReceive(SOAPEnvelope)
b- > engine.send (..)
c -> Send the SOAP message
d -> Receive the response over the synchronous transport
w -> ProviderX will be called as the last step in engine.receive(..) 
e -> provider returns       
f -> Call hand over the response to the client

Code Snippet:

call.setTargetURL(URL)
call.setAction(String)
SOAPEnvelope env=call.sendReceive(SOAPEnvelope)

sendReceiveAsync Invocation

The service method has a response and the communication happens synchronously using a bi-directional protocol. Client DOES NOT hang until the response (or fault) is returned. Client uses callback mechanism to retrieve the response. Call API uses threads from a thread pool for each invocation.

a -> call.sendReceiveAsync (SOAPEnvelope, callbackObj)
p -> correlator.addCorrelationInfor(msgID,allbackObjRef)
b- > engine.send (..)
c -> Send the SOAP message
d -> Receive the response over the synchronous transport
w -> ProviderX will be called as the last step in engine.receive(..) 
q -> correlator.getCorrelationInfo(msgID)
g -> callbackObj.onComplet()

Code Snippet:

call.setTargetURL(URL)
call.setAction(String)
call.setListenerTransport(“http”, true)
call.sendReceiveAsync (SOAPEnvelope, Callback)

sendReceiveAsync Invocation with One way transport

The service method has a response and the communication happens Aynchronously using a uni-directional protocol. Client DOES NOT hang until the response (or fault) is returned. Client uses callback mechanism to retrieve the response. Call API uses threads from a thread pool for each invocation.

a -> call.sendReceiveAsync (SOAPEnvelope, callbackObj)
p -> correlator.addCorrelationInfor(msgID,allbackObjRef)
b- > engine.send (..)
c -> Send the SOAP message
r -> Receive the response by the listener
s -> engine.receive(..)
w -> ProviderX will be called as the last step in engine.receive(..) 
q -> correlator.getCorrelationInfo(msgID)
g -> callbackObj.onComplet()

Code Snippet:

call.setTargetURL(URL)
call.setAction(String)
call.setListenerTransport(“http”, false)
call.sendReceiveAsync(SOAPEnvelope, Callback)

Sequence Diagrams

http://apache.org/~deepal/images/Diagram.png

FrontPage/Architecture/Client (last edited 2009-09-20 22:48:29 by localhost)