We have implemented webservices on Weblogic 10.3.
I am trying to test the webservices using the SOAP UI client (soapui.org).
but I get following error message:
Error 401--Unauthorized
Error 401--Unauthorized
From RFC 2068 Hypertext Transfer Protocol -- HTTP/1.1:
10.4.2 401 UnauthorizedThe request requires user authentication. The response MUST include a WWW-Authenticate header field (section 14.46) containing a challenge applicable to the requested resource. The client MAY repeat the request with a suitable Authorization header field (section 14.8). If the request already included Authorization credentials, then the 401 response indicates that authorization has been refused for those credentials. If the 401 response contains the same challenge as the prior response, and the user agent has already atte开发者_如何学运维mpted authentication at least once, then the user SHOULD be presented the entity that was given in the response, since that entity MAY include relevant diagnostic information. HTTP access authentication is explained in section 11.
Any idea if I need to do special config on SOAP UI.
Update: after following Zeger's advice, I did a basic authentication i.e. set the username and pwd (weblogic / weblogic) to header of SOAP request (in SOAP UI). However now I get following error:
<env:Envelope xmlns:env="http://schemas.xmlsoap.org/soap/envelope/"> <env:Body> <env:Fault xmlns:wsse="http://docs.oasis-open.org/wss/2004/01/oasis-200401-wss-wssecurity-secext-1.0.xsd"> <faultcode>wsse:InvalidSecurity</faultcode> <faultstring>Error codes: 1061 2661 1028 Error code:1061</faultstring> </env:Fault> </env:Body> </env:Envelope>
Probably too late to help with the original question, but this might help anyone who got here from the same Google search as me :)
Take a look at http://download.oracle.com/docs/cd/E12840_01/wls/docs103/security/thin_client.html#understanding_basic_atn.
By default, when Weblogic receives an HTTP request with an "Authorization=Basic ..." header, it checks the credentials provided. Since you've almost certainly not configured any security realms or users for Weblogic, you'll get a 401 back.
Your webservice needs authentication. So, if you want to test this service with SOAP UI, you need to pass the credentials using HTTP Header (the option to set headers is at the lower end of SOAPUI).
Read this more details.
probably your web service requires more complex security head like ws security username token or timestamp. you can not see this header in wsdl so soap ui wont be generating any tag for them.
you can check: http://download.oracle.com/docs/cd/E11035_01/wls100/webserv_sec/message.html#wp243698
+markl has the why of what exactly is happening in his answer... However to fix this in SOAP UI, you would do the following:
File->Preferences-> HTTP Settings
Uncheck the box that says 'Adds authentication information to outgoing request' this will allow the 'TestRequest Property' in the lower left hand box of SOAPUI to populate the header of the request only and not the 'Basic Authorization'.
If you want these settings to be saved, you save preferences:
File->Save Preferences
The above instruction is for soapUI 4.0.1 (but I imagine it works for all versions)
精彩评论