【发布时间】:2019-05-15 08:39:11
【问题描述】:
我正在尝试在 SoapUI 中创建一个示例请求,但我不确定如何让它工作。
这是一个 C# 中的工作示例:
var myService = new MyServiceClient("WSHttpBinding_MyService");
myService .ClientCredentials.UserName.UserName = "User";
myService .ClientCredentials.UserName.Password = "Password";
var response = myService.MyMethod("parameter1");
配置:
<system.serviceModel>
<bindings>
<wsHttpBinding>
<binding name="WSHttpBinding_IMyService">
<security mode="TransportWithMessageCredential">
<transport clientCredentialType="None" />
<message clientCredentialType="UserName" />
</security>
</binding>
</wsHttpBinding>
</bindings>
<client>
<endpoint address="https://myWebsite.com:8000/MyService.svc"
binding="wsHttpBinding" bindingConfiguration="WSHttpBinding_IMyService"
contract="MyService.IMyService" name="WSHttpBinding_IMyService" />
</client>
</system.serviceModel>
似乎在 SoapUI 中让它工作并不难,但我不断收到各种错误。
有人有这方面的工作示例吗?
【问题讨论】:
标签: .net wcf soapui ws-security