[英]Access wcf service with clientCredentialType=“UserName” using soapui
I have a WCF service which I'm trying to access using SoapUI. 我有一个WCF服务,正在尝试使用SoapUI访问。 The service is working fine and I'm able to access with a .net client application, but I'm not able to figure out how to access the service using SoapUI.
该服务运行良好,并且可以使用.net客户端应用程序进行访问,但无法弄清楚如何使用SoapUI访问该服务。 In C# I specify the username and password for the client like this
在C#中,我像这样指定客户端的用户名和密码
var client = new xxxService.xxxServiceClient();
client.ClientCredentials.UserName.UserName = "xxxx";
client.ClientCredentials.UserName.Password = "xxxxx";
but how do I specify the client credentials in soapui or in the xml 但是如何在soapui或xml中指定客户端凭据
This is what the request looks in soapui 这是请求在soapui中的样子
<soap:Envelope xmlns:soap="http://www.w3.org/2003/05/soap-envelope" xmlns:tem="http://tempuri.org/">
<soap:Header/>
<soap:Body>
<tem:GetUsers/>
</soap:Body>
</soap:Envelope>
In Navigator window in soapUI click on your WSDL item. 在soapUI的“导航器”窗口中,单击您的WSDL项目。 Second tab 'Service Endpoints' list all endpoints.
第二个标签“服务端点”列出了所有端点。 Second and third columns are Username and Password.
第二和第三列是用户名和密码。 Enter your credentials there.
在此输入您的凭据。
You need to add WS-Security Configuration to your request. 您需要将WS-Security Configuration添加到您的请求中。 Read this http://www.soapui.org/SOAP-and-WSDL/applying-ws-security.html
阅读此http://www.soapui.org/SOAP-and-WSDL/applying-ws-security.html
And see the section under "Username". 并查看“用户名”下的部分。 And then in your testsuite in soapUI, be sure to add the ws-security conf you just created.
然后在soapUI的测试套件中,确保添加刚创建的ws-security conf。 That worked for me.
那对我有用。
Soap UI on the bottom left in Request Properties tab double click "Username" and "Password" and changed. 在“请求属性”选项卡左下方的Soap UI中,双击“用户名”和“密码”并进行更改。 You are still getting errors change same tab "WSS-Password Type" PasswordText
您仍在更改相同的选项卡“ WSS密码类型” PasswordText时出错
声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.