Setting Connection timeout (not Socket Read timeouts !!) with Axis 1.4?

2008-02-19 Thread Sri Rama Kanth N
How to set/specify http Connection timeout property/value to fail fast
rather than waiting for long times?

(SoapStub))._setProperty(axis.connection.timeout, new
Integer(connTimeout));

(SoapStub).setTimeout(timeoutvalue)

The  above two ways (setting on the axis stubs) will set a time out on the
Socket.

I want  set it only on initial Connection establishment rather than read
timeouts. How can this be made with Axis 1.4 stubs?


Problems Using CommonsHTTPSender as http Handler for Axis Client [CRITICAL]

2008-02-17 Thread Sri Rama Kanth N
Hi,

I have used Axis 1.4  as Web service Client for consuming some external web
services. I have to use a proxy host(in our network) to connect to external
services which is currently handled by setting it in the System Properties.

Things were working fine with the defualt HttpSender which handles stuff
between Client and the Soap Server.

I came across CommonHttpSender which can be used to to get control of some
settings like setting  connections pools and Connection timeout(which i am
interested in) etc.,

When I replaced the HttpSender to CommonsHttpSender in the
clilent-config.wsdd, I am facing problems to get it working..
*
Problem 1:*
When a proxy is enabled(System Properties) and session enabled(
_locator.setMaintainSession(true);)  since I need to maintain session

 I get NullPointerException on Line 190  in CommonsHttpSender  ( boolean
secure =* hostConfiguration.getProtocol()*.isSecure();) .. I don't why..:-(

I fixed(temp work around) it by extending this Sender and overrided the
getHostConfiguration() method by adding  the below line explicitly
config.setHost(targetURL.getHost(), port, targetURL.getProtocol()); in
what ever the case may be.

*Problem 2:*
The above work around fixes the NullPointerException but now  get
org.apache.commons.httpclient.NoHttpResponseException

When I run the same program with out proxy setting (out of our network) I
get
(404)Object Not Found
at org.apache.axis.transport.http.CommonsHTTPSender.invoke(
CommonsHTTPSender.java:218)

I am not sure why the same Service works with defualt HttpSender but not
with the CommonsHttpSender.

Is there any thing like configuration etc., which I missed out  thats needs
to be taken care to plug in the CommonsHttpSender.

Any sort of help is appreciated

*Environment: Apache Axis 1.4, commons-httpclient-3.0.1.jar, Java
1.5(150_06) and all  supporting jars.
*
Thanks
Sri*
*