You are viewing a plain text version of this content. The canonical link for it is here.
Posted to java-dev@axis.apache.org by Sri Rama Kanth N <n....@gmail.com> on 2008/02/17 16:12:46 UTC

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

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*
*