Title: Axis client and .NET Web Service using NTLM security

Hi,
I have spent about a week researching this and google just isn't getting me a viable working solution.  Please advise if possible.

I am using Axis code which I generated using wsdl2java.  I need to communicate with a .NET web service that uses the ntlm authentication scheme.  I do not want to go the client-config.wsdd route.  I would rather specify that I want to use the CommonsHTTPSender class programatically.

In my generated axis stub (and I wish I didn’t have to modify a stub..) I have added the following lines of code to the createCall() method (it is surrounded by comments):


<CODE>
protected org.apache.axis.client.Call createCall() throws java.rmi.RemoteException {
   try {
       org.apache.axis.client.Call _call = (org.apache.axis.client.Call) super.service.createCall();

       // Use HttpClient for ntlm. - start
       org.apache.axis.transport.http.CommonsHTTPSender reqConnectionHandler = new org.apache.axis.transport.http.CommonsHTTPSender();

       org.apache.axis.transport.http.CommonsHTTPSender respConnectionHandler = new org.apache.axis.transport.http.CommonsHTTPSender();

       _call.setClientHandlers(reqConnectionHandler,respConnectionHandler);
           
       super.setUsername("QA-DOMAIN\\andyh");
       super.setPassword("VikesDominatePackers");
       // Use HttpClient for ntlm. - end

       if (super.maintainSessionSet) {
           _call.setMaintainSession(super.maintainSession);
       }

       ...
</CODE>

  
The resulting POST from TCPMON is this:

POST /imgservice.asmx HTTP/1.1
Content-Type: text/xml; charset=utf-8
SOAPAction: "http://wellsfargo.com/provide/image/performView/2005/"
Authorization: Basic QUQfGN5UXGFJeUdIldhdGVyMTImQPA==
User-Agent: Jakarta Commons-HttpClient/3.0.1
Host: localhost:9001
Content-Length: 559

<soapenv:Envelope xmlns:soapenv="http://schemas.xmlsoap.org/soap/envelope/" xmlns:xsd="http://www.w3.org/2001/XMLSchema"


This is the resulting error from my java console:

- Unable to find required classes (javax.activation.DataHandler and javax.mail.internet.MimeMultipart). Attachment support is disabled.

- ntlm authentication scheme selected
- Failure authenticating with NTLM <any realm>@localhost:9001
- Error in ezimg service.  AxisFault caught.  MessageId: null
AxisFault
 faultCode: {http://xml.apache.org/axis/}HTTP
 faultSubcode:
 faultString: (401)Unauthorized
 faultActor:
 faultNode:
 faultDetail:
        {}:return code:  401


So it appears NTLM is being used because of the second line output above, however the TCPMON output states that BASIC authentication is being used.  I am very confused by this.  Thanks for helping!!!!

Andy




Andrew Hahn
HCFTG - Sales Technology Group
Technology Information Group


This message may contain confidential and/or privileged information.  If you are not the addressee or authorized to receive this for the addressee, you must not use, copy, disclose, or take any action based on this message or any information herein.  If you have received this message in error, please advise the sender immediately by reply e-mail and delete this message.  Thank you for your cooperation.



Reply via email to