You are viewing a plain text version of this content. The canonical link for it is here.
Posted to java-user@axis.apache.org by Timour Mouratov <mt...@gmail.com> on 2005/02/15 22:23:59 UTC

Asynchronous/synch service

Hi all, 

I'm new to Axis and  I'm stuck with problem.  
I need to add asynchronous communication logic to an existing
services, so the services could communicate in sync as it know and
async modes.   I checked articles on the net and axis proposal to
async comm in CVS  but I don't think it fits to my requirements.  I
need to keep interop with .NET clients so JMS is out  and I don't
really  want to change a service's schema.

So here are my thoughts:
 
My service has one operation with IN and OUT :  
   public ConmplextType opreation(ComplexType in) . 

I can: 
1) implement a handler where I can intercept  request to the service
in :  Hanler.handleRequest(). In this method I will:
    1.1) Check SOAP header to find out if client wants to use async comm. 
    1.2) Deserialize  a  message by myself .
    1.3) Look-up target service and invoke it using aynch method. I
can force service to  implement my interface , so I will know which
method to invoke for async comm.
    1.4)  return false from Hanler.handleRequest().

I believe I have all necessary  information in
org.apache.axis.MessageContext to do it.

3) set a null as an output from service operation. Add correlation id
to the header of the response.
4) Next time when client comes with correlation id in header of the
request I can check if service processing is done and return response
by serializing it in handleResponse() method.

My problem is on steps 1.2 and 1.3. It  looks like I need to
re-implement the following:
- org.apache.axis.providers.java.JavaProvider.invoke(MessageContext)
- org.apache.axis.providers.java.RPCProvider.processMessage(MessageContext,
 SOAPEnvelope, SOAPEnvelope , Object) .

Is there a more proper ways of doing it ?  Does axis allow me to
intercept serialize/serialize   processes somehow ?

Thanks.

Timour