0

We're all familiar with doing authentication in a soap header

<soapenv:Header>
  <wsse:Security soapenv:mustUnderstand="1" xmlns:wsse="http://docs.oasis-open.org/wss/2004/01/oasis-200401-wss-wssecurity-secext-1.0.xsd">
     <wsse:UsernameToken wsu:Id="UsernameToken-18" xmlns:wsu="http://docs.oasis-open.org/wss/2004/01/oasis-200401-wss-wssecurity-utility-1.0.xsd">
        <wsse:Username>userName</wsse:Username>
        <wsse:Password Type="http://docs.oasis-open.org/wss/2004/01/oasis-200401-wss-username-token-profile-1.0#PasswordText">password</wsse:Password>
     </wsse:UsernameToken>
  </wsse:Security>

And imitating it in java using SOAPHandler. Unfortunately I have one web service where this just ends with a 401. The only way I can get a response in SOAP UI is using the username/password properties for the request.

https://i.stack.imgur.com/kwbbx.jpg

Pic of what I'm talking about in SOAPUI. The problem is I don't know how to set the properties that way in Java.

John M
  • 310
  • 4
  • 15

1 Answers1

1

When you set the username and password in those fields in SoapUI you are using basic authentication. This becomes a HTTP header named Authorization.

See this answer.

Community
  • 1
  • 1
Sean Kuhlman
  • 502
  • 3
  • 13
  • Thanks. That answer didn't actually help, because I'm using autogen classes from wsimport, but it told me what to google. This answer is what I ended up using: http://stackoverflow.com/a/7086636/2561658 – John M Dec 10 '14 at 16:43