English 中文(简体)
使用SOAP UI测试Weblogic Web服务
原标题:Testing Weblogic webservices using SOAP UI

我们已经在Weblogic 10.3上实现了Web服务。

我正在尝试使用soapui客户端(soapui.org)测试Web服务。

但我收到以下错误消息:

Error 401--Unauthorized

Error 401--Unauthorized

From RFC 2068 Hypertext Transfer Protocol -- HTTP/1.1:

10.4.2 401 Unauthorized

The 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 attempted 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.

如果我需要对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> 
问题回答

可能为时已晚,无法回答最初的问题,但这可能会帮助任何和我一样从谷歌搜索到这里的人:)

看看http://download.oracle.com/docs/cd/E12840_01/wls/docs103/security/thin_client.html#understanding_basic_atn

默认情况下,当Weblogic接收到具有“Authorization=Basic…”标头的HTTP请求时,它会检查所提供的凭据。由于您几乎肯定没有为Weblogic配置任何安全领域或用户,因此您将获得401回报。

您的Web服务需要身份验证。因此,如果您想使用SOAPUI测试此服务,则需要使用HTTPHeader传递凭据(设置Header的选项位于SOAPUI的下端)。

阅读更多详细信息。

您的web服务可能需要更复杂的安全头,如ws-securityusernametoken或timestamp。您在wsdl中看不到这个头,所以soapui不会为它们生成任何标记。

you can check: http://download.oracle.com/docs/cd/E11035_01/wls100/webserv_sec/message.html#wp243698

+马克尔在他的回答中说出了究竟发生了什么。。。但是,要在SOAP UI中修复此问题,您需要执行以下操作:

文件->;首选项->;HTTP设置

取消选中“将身份验证信息添加到传出请求”框,这将允许SOAPUI左下角框中的TestRequest属性仅填充请求的标头,而不填充基本授权。

如果要保存这些设置,请保存首选项:

文件->;保存首选项

以上说明适用于soapUI 4.0.1(但我认为它适用于所有版本)





相关问题
IIS 6.0 hangs when serving a web-service

I am having issues with one of our web-services. It works fine on my development machine (win XP) whether I host it as a separate application or using cassini from Visual studio. Once I deploy on the ...

ASP.net web services

I am using a web service which sets the Thread.CurrentPrincipal object while logging in and soon later when another webmethod of the same web service accesses Thread.CurrentPrincipal, its different/...

Unity Container Disposing and XML Web Service

I am registering some wrapers over un-managed objects in container. How can I dispose of them at the end of the container s lifetime? Please bear in mind I have an XML Web service.

SharePoint : web service permission error

I have a sharepoint site, and I am calling a standard sharepoint web service. I create the web service request like this : wsDws.Url = this.SiteAddress + @"/_vti_bin/Dws.asmx"; When I use ...

热门标签