Dears:
I have one problem needed your recommendations. At present, I want
to code my web service client with non-blocking or asynchronous manner. It
measn once my client sends its requests, it can do other things continually
without waiting for its replies. However, I still have not found any
suitable sample codes after surveying many on-line documentations or
materals.
Since I use the Axis 1.4.1 version, I found some on-line sample
codes use those deprecated classes or methods. Therefore, anyone can give me
the workable sample codes. I will appreciate your assistances.
In addition, I need to handle the replied data even if I use the
asynchronous web service. So, the sample code should demonstrate how to get
the replied data. Because I aslo find some on-line code doesn't claim the
following story after asynchronous web service invocation looked like the
following code snippet.
try {
org.apache.axis2.userguide.Axis2SampleDocLitServiceStub stub
= new
org.apache.axis2.userguide.Axis2SampleDocLitServiceStub(null,
"http://localhost:8080/axis2/services/Axis2SampleDocLitService
");
//implementing the callback online
org.apache.axis2.userguide.Axis2SampleDocLitServiceCallbackHandler callback
=
new
org.apache.axis2.userguide.Axis2SampleDocLitServiceCallbackHandler() {
public void receiveResultechoString(
org.apache.axis2.userguide.xsd.EchoStringReturnDocument resDoc) {
System.out.println(resDoc.getEchoStringReturn());
}
};
org.apache.axis2.userguide.xsd.EchoStringParamDocument reqDoc =
org.apache.axis2.userguide.xsd.EchoStringParamDocument.Factory.newInstance();
reqDoc.setEchoStringParam("Axis2 Echo");
stub.startechoString(reqDoc, callback);
// After the above line, I don't know how to get the replied data
} catch (java.rmi.RemoteException e) {
e.printStackTrace();
}