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.sstatic.net/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.

1 Answer 1

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.

Sign up to request clarification or add additional context in comments.

1 Comment

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: stackoverflow.com/a/7086636/2561658

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy.

Start asking to get answers

Find the answer to your question by asking.

Ask question

Explore related questions

See similar questions with these tags.