Hi,

I am new to web service and AXIS2 engine. I have a basic doubt about the 
asynchronous web service AXIS2 provides. Does it provide a complete 
asynchronous communication? I have seen the following code in AXIS2 site, the 
client basically waits until a response comes from server. Comparing this with 
JMS/MQ communication, the client does not wait when a message is put in the 
queue and a seperate a seperate MDB picks up the response when send by server.

try {
            OMElement payload = ClientUtil.getEchoOMElement();

            Options options = new Options();
            options.setTo(targetEPR);
            options.setTransportInProtocol(Constants.TRANSPORT_HTTP);
            options.setUseSeparateListener(true);
            options.setAction("urn:echo");  // this is the action mapping we 
put within the service.xml

            //Callback to handle the response
            Callback callback = new Callback() {
                public void onComplete(AsyncResult result) {
                    System.out.println(result.getResponseEnvelope());
                }

                public void onError(Exception e) {
                    e.printStackTrace();
                }
            };
            //Non-Blocking Invocation
            sender = new ServiceClient();
            sender.engageModule(new QName(Constants.MODULE_ADDRESSING));
            sender.setOptions(options);
            sender.sendReceiveNonBlocking(payload, callback);
            //Wait till the callback receives the response.
            while (!callback.isComplete()) {
             Thread.sleep(1000);
            }
            //Need to close the Client Side Listener.
            } catch (AxisFault axisFault) {
              axisFault.printStackTrace();
            } catch (Exception ex) {
              ex.printStackTrace();
            } finally {
            try {
                sender.cleanup();
            } catch (AxisFault axisFault) {
                //have to ignore this
            }
        }


Can somebody share with me a sample asynchronous web service client code using 
AXIS2 1.3?

Thanks and Regards,

Chiradeep

**************** CAUTION - Disclaimer *****************
This e-mail contains PRIVILEGED AND CONFIDENTIAL INFORMATION intended solely 
for the use of the addressee(s). If you are not the intended recipient, please 
notify the sender by e-mail and delete the original message. Further, you are 
not to copy, disclose, or distribute this e-mail or its contents to any other 
person and any such actions are unlawful. This e-mail may contain viruses. 
Infosys has taken every reasonable precaution to minimize this risk, but is not 
liable for any damage you may sustain as a result of any virus in this e-mail. 
You should carry out your own virus checks before opening the e-mail or 
attachment. Infosys reserves the right to monitor and review the content of all 
messages sent to or from this e-mail address. Messages sent to or from this 
e-mail address may be stored on the Infosys e-mail system.
***INFOSYS******** End of Disclaimer ********INFOSYS***

---------------------------------------------------------------------
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]

Reply via email to