Note that there are some explanatory texts on larger screens.

plurals
  1. PO
    text
    copied!<p>I don't think that you're currently creating the appropriate HTTP header for Basic Authentication. I'm not sure how you create the SOAP request but if you're using a JAX-WS client, the JAX-WS FAQ documents the following:</p> <blockquote> <h3><a href="https://jax-ws.dev.java.net/faq/index.html#auth" rel="nofollow">Q. How do I do basic authentication in JAX-WS?</a></h3> <p>You can do the following:</p> <pre><code>HelloService service = new HelloService(); Hello proxy = (service.getHelloPort()); ((BindingProvider)proxy).getRequestContext().put(BindingProvider.USERNAME_PROPERTY, "userfoo"); ((BindingProvider)proxy).getRequestContext().put(BindingProvider.PASSWORD_PROPERTY, "passbar"); </code></pre> <p>USERNAME_PROPERTY, PASSWORD_PROPERTY are used primarily for service requests. I think when you instantiate Service, it fetches WSDL and the server is returning 401. You could try any one of the following solutions.</p> <ol> <li>Use java.net.Authenticator class in your client application.</li> <li>Provide a local access to the WSDL using catalog. There is a catalog sample in the jax-ws distribution.</li> <li>Configure web.xml to allow GET requests without authentication</li> </ol> </blockquote> <p>And unless I'm wrong, the usernametoken would fit if the webservice expects the authentication in the SOAP header, which is not the case according to your description.</p> <p>In other words, for me, you're currently not sending the credentials for the BASIC auth.</p> <h3>See also</h3> <ul> <li><a href="http://download.oracle.com/javaee/5/tutorial/doc/bncbx.html#bnccv" rel="nofollow">Example: Basic Authentication with JAX-WS</a> </li> <li><a href="http://www.ryandelaplante.com/2007/06/ssl-and-http-basic-authentication-with.html" rel="nofollow">SSL and HTTP BASIC authentication with Glassfish and JAX-WS</a> (more complex scenario)</li> </ul>
 

Querying!

 
Guidance

SQuiL has stopped working due to an internal error.

If you are curious you may find further information in the browser console, which is accessible through the devtools (F12).

Reload