File APIs for Java Developers
Manipulate DOC, XLS, PPT, PDF and many others from your application.
The moose likes Web Services and the fly likes Adding Basic Authetication to SOAP  Message Big Moose Saloon
  Search | Java FAQ | Recent Topics | Flagged Topics | Hot Topics | Zero Replies
Register / Login

Win a copy of Groovy Fundamentals video training course this week in the Groovy forum!
JavaRanch » Java Forums » Java » Web Services
Bookmark "Adding Basic Authetication to SOAP  Message" Watch "Adding Basic Authetication to SOAP  Message" New topic

Adding Basic Authetication to SOAP Message

Dave Ehrlich

Joined: Nov 12, 2002
Posts: 20
I want to add a userid and password to my HTTP header when I am using SOAPto call a web service.
I am sending my SOAP message (web service) using message.send(). This doesn't accept any arguments for user id and password. However, the send() method instantiates a SOAPHTTPConnection object which does have a setUserName() and setPassword() method. These end up in the HTTP Header collection. However, when message.send calls the SOAPHTTPConnection.send() method it sets the Headers parameter to null.
So I do I get the username and password in the SOAP message for Basic Authentication? I don't think that creating a SOAPHTTPConnection object in my code would work since message.send() creates a new one.
Any help would be appreciated.
I agree. Here's the link:
subject: Adding Basic Authetication to SOAP Message