This week's book giveaway is in the OO, Patterns, UML and Refactoring forum. We're giving away four copies of Refactoring for Software Design Smells: Managing Technical Debt and have Girish Suryanarayana, Ganesh Samarthyam & Tushar Sharma on-line! See this thread for details.
// Set HTTP headers. // This does not work!!! String authorization = new sun.misc.BASE64Encoder().encode((username+":"+password).getBytes()); MimeHeaders hd = message.getMimeHeaders(); hd.addHeader("Authorization", "Basic " + authorization);
// Create and populate the body SOAPBody body = envelope.getBody();
There's currently a bug in Axis2 that prevents any SOAP headers from being transmitted. I'm trying to get the priority on that one raised, but have no word yet on when it might be fixed.
This means that SAAJ clients can't use HTTP authentication with the Axis2 libraries. The workarounds would be either to use the Axis1 libraries for the client, or to use a JAX-WS client. [ November 17, 2008: Message edited by: Ulf Dittmer ]