views:

52

answers:

1

Is it possible to cancel a SOAP request (Axis 1.4, Java 1.6) that's currently executing?

I'm using the interfaces generated with WSDL2Java, so the call is something like myProvider.submitMyRequest(request). This is synchronous and doesn't return until a response is received. I want to be able to interrupt the call based on an external condition. Short of killing the thread that runs the request, what are my options?

A: 

I haven't been able to find a way. The closest solution I found was to set a timeout on the Stub class (cast myProvider to Stub) and run the request in a thread that could be left to timeout without blocking the rest of the system.

tro