简体   繁体   English

使用soapui使用clientCredentialType =“ UserName”访问wcf服务

[英]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.

相关问题 将xml请求中的用户名和密码传递给wcf服务进行身份验证? - Pass in username and password in an xml request to wcf service for authentication? WCF服务 - 使用json调用客户端访问休息时未提供正确的内容类型 - WCF Service - calling a client to access rest using json is not giving correct content type WCF服务中使用GetReaderAtBodyContents的“文件意外结束” - “Unexpected End of file” using GetReaderAtBodyContents in WCF Service 访问我的WCF服务的/ App_Data文件夹中的XML文件? - Access an XML file in /App_Data folder of my WCF service? SoapUI在模拟服务脚本中获取请求参数 - SoapUI getting request parameters in mock service script 如何使用VB6调用WCF服务并设置其配置 - How to call WCF service and set its configuration using VB6 如何在WCF服务中获取Xml作为字符串并使用javascript发送? - how to get Xml as string in wcf service and send using javascript? 使用 WebInvoke 在 WCF REST 服务的主体中传递 XML 字符串 - Passing XML string in the body of WCF REST service using WebInvoke 使用PostAsync将XML传输到自托管WCF服务 - Transmitting XML to a self-hosted WCF service using PostAsync 使用IDispatchOperationSelector命中服务之前更新Wcf消息时出错 - Error updating Wcf message before hitting service using IDispatchOperationSelector
 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM