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 "Camara Melgosa, Javier" <JC...@softwareag.es> on 2005/05/11 18:48:23 UTC

CommonsHTTPSender failing to set host name

Hi all. I am using Axis 1.2 to trespass a firewall with authentication.
Until yesterday the authentication method was Basic and I solved it by
altering the REQUEST_HEADERS of the call, but now it asks for an Active
Directory domain so it may be NTLM. Thus I configured client-config.wsdd to
use CommonsHTTPSender, and installed commons-codec-1.3.jar in the classpath.
But I got the following exception:
 
java.lang.IllegalArgumentException: host parameter is null
        at
org.apache.commons.httpclient.HttpConnection.&lt;init&gt;(HttpConnection.jav
a:206)
        at
org.apache.commons.httpclient.HttpConnection.&lt;init&gt;(HttpConnection.jav
a:155)
        at
org.apache.commons.httpclient.MultiThreadedHttpConnectionManager$HttpConnect
ionWithReference.&lt;init&gt;(MultiThreadedHttpConnectionManager.java:1123)
        at
org.apache.commons.httpclient.MultiThreadedHttpConnectionManager$ConnectionP
ool.createConnection(MultiThreadedHttpConnectionManager.java:748)
        at
org.apache.commons.httpclient.MultiThreadedHttpConnectionManager.doGetConnec
tion(MultiThreadedHttpConnectionManager.java:469)
        at
org.apache.commons.httpclient.MultiThreadedHttpConnectionManager.getConnecti
onWithTimeout(MultiThreadedHttpConnectionManager.java:394)
        at
org.apache.commons.httpclient.HttpMethodDirector.executeMethod(HttpMethodDir
ector.java:152)
        at
org.apache.commons.httpclient.HttpClient.executeMethod(HttpClient.java:393)
        at
org.apache.axis.transport.http.CommonsHTTPSender.invoke(CommonsHTTPSender.ja
va:186)
        at
org.apache.axis.strategies.InvocationStrategy.visit(InvocationStrategy.java:
32)
        at org.apache.axis.SimpleChain.doVisiting(SimpleChain.java:118)
        at org.apache.axis.SimpleChain.invoke(SimpleChain.java:83)
        at org.apache.axis.client.AxisClient.invoke(AxisClient.java:165)
        at org.apache.axis.client.Call.invokeEngine(Call.java:2765)
        at org.apache.axis.client.Call.invoke(Call.java:2748)
        at org.apache.axis.client.Call.invoke(Call.java:1784)
 (...)
 
Then I had a look into CommonsHTTPSender and saw that the
getHostConfiguration(HttpClient, MessageContext, URL) method seemed to fail
to call config.setHost() when there is a proxy host. I patched it by copying
and pasting the following line at the proper spot (just after
config.setProxy() ):
 
 config.setHost(targetURL.getHost(), port, targetURL.getProtocol());
 
And I tested it again; but then I got a 501 error from the firewall, which
is squid/2.5.STABLE9:
 
 501 Unsupported Request Method and Protocol
 Squid does not support all request methods for all access protocols.
 For example, you can not POST a Gopher request.
 
The call was a POST issued by UDDI4j. So it seems that:
a) CommonsHTTPSender has a bug: it does not set the host when there is a
proxy
b) The Commons HTTP library is not able to work with my concrete firewall
 
I guess this is not the forum to discuss about b), but do you have any
opinion about a) ? Will you change the class, or do you want me to submit
the change in any way?
 
Regards
--
Javier Cámara (jcamara@softwareag.es <ma...@softwareag.es> )
Software Architect, Software AG España, S.A.
Ronda de la Luna, 22; 28760 Tres Cantos (Spain)
+34 91 807 9400, fax +34 91 807 9447