[jboss-user] [JBossWS] - Re: SAAJ API & basic authentication (AS 4.0.4)

mhae do-not-reply at jboss.com
Thu Sep 14 18:27:13 EDT 2006


Thanks. I couldn't find the test case you are talking about
but it is probably similar to this:

MessageFactory messagefactory = MessageFactory.newInstance();
    SOAPMessage message = messagefactory.createMessage();
    
    SOAPPart soapPart =     message.getSOAPPart();
    SOAPEnvelope envelope = soapPart.getEnvelope();
    SOAPBody body =         envelope.getBody();
    
    // System.setProperty("http.basic.username", "webservice");
    // System.setProperty("http.basic.password", "webservice");
    
    StringBuffer buffer = new StringBuffer();
    buffer.append("webservice");
    buffer.append(":");
    buffer.append("webservice");
    String encoded = Base64.encodeBytes(buffer.toString().getBytes());
    String authString = "Basic " + encoded;  
    message.getMimeHeaders().addHeader("Authorization", authString);

View the original post : http://www.jboss.com/index.html?module=bb&op=viewtopic&p=3971737#3971737

Reply to the post : http://www.jboss.com/index.html?module=bb&op=posting&mode=reply&p=3971737



More information about the jboss-user mailing list