![](/img/trans.png)
[英]Pass in username and password in an xml request to wcf service for authentication?
[英]Access wcf service with clientCredentialType=“UserName” using soapui
我有一个WCF服务,正在尝试使用SoapUI访问。 该服务运行良好,并且可以使用.net客户端应用程序进行访问,但无法弄清楚如何使用SoapUI访问该服务。 在C#中,我像这样指定客户端的用户名和密码
var client = new xxxService.xxxServiceClient();
client.ClientCredentials.UserName.UserName = "xxxx";
client.ClientCredentials.UserName.Password = "xxxxx";
但是如何在soapui或xml中指定客户端凭据
这是请求在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>
在soapUI的“导航器”窗口中,单击您的WSDL项目。 第二个标签“服务端点”列出了所有端点。 第二和第三列是用户名和密码。 在此输入您的凭据。
您需要将WS-Security Configuration添加到您的请求中。 阅读此http://www.soapui.org/SOAP-and-WSDL/applying-ws-security.html
并查看“用户名”下的部分。 然后在soapUI的测试套件中,确保添加刚创建的ws-security conf。 那对我有用。
在“请求属性”选项卡左下方的Soap UI中,双击“用户名”和“密码”并进行更改。 您仍在更改相同的选项卡“ WSS密码类型” PasswordText时出错
声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.