Change the timeout setting of the generated Axis 1.4 Java SOAP client

I'm having a problem changing the default parameters used by the Axis 1.4 Web service client code. We are using a specific partner webservice that uses the old RPC / Encoded style, which basically means we cannot upgrade to Axis 2, but limited to Axis 1.4.

The service client pulls data from the remote server through our proxy, which actually works pretty well.

Our application is deployed as a servlet. The resulting response from the external web service is inserted into a document (XML) that we provide to our internal systems / CMS. But if the external service does not respond, which has not happened yet, but can happen at any time - we want to degrade nicely and return our prepared XML document without the calculated information of the web service during the reporting time. The data obtained is optional (if this particular calculation is missing, it is not a big problem).

So, I tried to change the timeout settings. I have applied / used all the methods and keys I could find in the axis documentation to change the connection time and socket timeout by searching the web. None of these affect connection timeouts.

Can anyone give me advice on how to change the settings for perch / service / port based on version 1.4?

Here's an example of several configurations I've reviewed:

MyService service = new MyServiceLocator();
MyServicePort port = null;

try {
    port = service.getMyServicePort();
    javax.xml.rpc.Stub stub = (javax.xml.rpc.Stub) port;
    stub._setProperty("axis.connection.timeout", 10);
    stub._setProperty(org.apache.axis.client.Call.CONNECTION_TIMEOUT_PROPERTY, 10);
    stub._setProperty(org.apache.axis.components.net.DefaultCommonsHTTPClientProperties.CONNECTION_DEFAULT_CONNECTION_TIMEOUT_KEY, 10);
    stub._setProperty(org.apache.axis.components.net.DefaultCommonsHTTPClientProperties.CONNECTION_DEFAULT_SO_TIMEOUT_KEY, 10);

    AxisProperties.setProperty("axis.connection.timeout", "10");
    AxisProperties.setProperty(org.apache.axis.client.Call.CONNECTION_TIMEOUT_PROPERTY, "10");
    AxisProperties.setProperty(org.apache.axis.components.net.DefaultCommonsHTTPClientProperties.CONNECTION_DEFAULT_CONNECTION_TIMEOUT_KEY, "10");
    AxisProperties.setProperty(org.apache.axis.components.net.DefaultCommonsHTTPClientProperties.CONNECTION_DEFAULT_SO_TIMEOUT_KEY, "10");

    logger.error(AxisProperties.getProperties());

    service = new MyClimateServiceLocator();
    port = service.getMyServicePort();
}

      

I assigned property changes before the service was generated and after that, I set the properties during initialization, I tried several other timeout keys I found ... I think I'm angry about this and starting to forget what I tried already!

What am I doing wrong? I mean, there must be an option, right?

If I don't find the right solution, I thought about setting up a timed out synchronized thread inside our code, which actually feels pretty awkward and kind of silly. Can you imagine anything else?

Thank you in advance

Jens


axis1.4 java client soap wsdl2java rpc / xml encoded servlet generated change settings change timeout connection timeout socket keys methods

+3


source to share


2 answers


I think it might be a bug, as pointed out here:



https://issues.apache.org/jira/browse/AXIS-2493?jql=text%20~%20%22CONNECTION_DEFAULT_CONNECTION_TIMEOUT_KEY%22

+3


source


The Typecast service port object for org.apache.axis.client.Stub.

(i.e.) org.apache.axis.client.Stub stub = (org.apache.axis.client.Stub) port;



Then set all properties:

stub._setProperty (org.apache.axis.client.Call.CONNECTION_TIMEOUT_PROPERTY, 10); stub._setProperty (org.apache.axis.components.net.DefaultCommonsHTTPClientProperties.CONNECTION_DEFAULT_CONNECTION_TIMEOUT_KEY, 10); stub._setProperty (org.apache.axis.components.net.DefaultCommonsHTTPClientProperties.CONNECTION_DEFAULT_SO_TIMEOUT_KEY, 10);

0


source







All Articles