Huitang Li wrote:

Hi,

I chose to use asynchronous calls in Axis2 client to transmit soap messages. The test class is generated by wsdl2java. When I tested it, the test did not fail even if the handler is set to fail() in the receiveErrorXXX() which in turn indeed got called.

This problem does not happen in synchronous calls.

Any solution to test asynchronous calls?


Thanks.



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



If you want to test Axis2 asynchronus invocation, you can follow the simple scenario given below. It actually verifies the asynchronus invocation (Verifies that the client does not block while invoking a service).

- create a service implementation class (a pojo with one method)
- Add Thread.sleep(some milli second value); in the service method
- Generate a sync client
- In the client add system.out("something") after service call;
- call the service
- You will observe that the client responds only after the service is invoked. Until that, client hangs and stops processing.

- Now generate an asynchrouns client and follow the above steps. You will notice that the client responds (you may see the system.out value before getting the service response) before getting the service response. (Client does not block and continues its operation)

Hope this helps you.

Bye
Charitha

--
Charitha Kankanamge
WSO2 inc.
Flower Road, Colombo 07
+94 714268070

A bug in the hand is better than one as yet undetected



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

Reply via email to