To set HTTP header in a SOAP message :

SOAPConnectionFactory factory = SOAPConnectionFactory.newInstance();

SOAPConnection soapConnection =factory.createConnection();

SOAPMessage message = MessageFactory.newInstance().createMessage(null,yourInputStream);

message.getMimeHeaders().addHeader("header name", "header value");

soapConnection.call(message, "server url");

Advertisements