I'm working with a bit of a legacy component in which we interact with a SOAP web service (a technology which I absolutely, positively abhor) using some client code built using the JAXRPC-RI (reference implementation) library.
I'm interested in being able to set a timeout with the stubs so that in case the web services server does not reply within X seconds, the application isn't setting there forever waiting for a response.
I'm using to working with clients/stubs generated by Apache Axis, in which you can simply use org.apache.axis.client.Stub.setTimeout()
to set a timeout.
For the life of me I can't figure out how to set a timeout when using Stubs created with JAXRPC-RI:
- The port class I am instantiating extends
com.sun.xml.rpc.client.StubBase
and implementsjavax.xml.rpc.Stub
andcom.sun.xml.rpc.spi.runtime.StubBase
. - The JavaDocs for none of these classes mention any sort of timeout or method to do this.
- Trying code like
stub._setProperty("axis.connection.timeout", 1000);
results in an exception at runtime:javax.xml.rpc.JAXRPCException: Stub does not recognize property: axis.connection.timeout
Does anyone have any ideas on how to set/enforce a timeout when using a JAXRPC-RI client? Is it even possible?