I work with a slightly outdated component in which we interact with the SOAP web service (a technology that I absolutely, positively hate) using some client code built using the JAXRPC-RI library (reference implementation).
I am interested in setting a timeout using stubs so that if the web services server does not respond within X seconds, the application does not set there to wait for a response forever.
I use Apache Axis-generated clients / stubs to work with, in which you can simply use org.apache.axis.client.Stub.setTimeout() to set a timeout.
Throughout life, I cannot figure out how to set a timeout when using Stubs created using JAXRPC-RI:
- The port class that I create extends
com.sun.xml.rpc.client.StubBase and implements javax.xml.rpc.Stub and com.sun.xml.rpc.spi.runtime.StubBase . - In JavaDocs, none of these classes mention any timeout or method for this.
- Attempted code like
stub._setProperty("axis.connection.timeout", 1000); raises 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 / apply a timeout when using the JAXRPC-RI client? Is it possible?
java java-ee soap web-services jax-rpc
matt b
source share