How to make authorization preemptive using SOAPEnvelope mime headers?
SOAPEnvelope envelope = soapPart.getEnvelope();
MimeHeaders mimeHeaders = soapMessage.getMimeHeaders();
mimeHeaders.addHeader("Content-type", "text/xml");
String authorization = new sun.misc.BASE64Encoder().encode(("user:pass").getBytes());
mimeHeaders.addHeader("Authorization", "Basic " + authorization);
Add the SOAPAction. I was also facing the same issue. In my case SOAPAction is the operation name.