如何解决C#SOAP服务配置问题
我想连接一个肥皂网络服务。我在项目中添加了Web参考,但是出现了一个错误,称为“政策伪造”。我试了很多我检查了我的配置文件。我检查绑定和端点名称等。为什么会出现此错误“ Policy Falsified”?这是我的代码。谢谢
这是绑定代码和端点代码;
<binding name="ServiceSoap">
<security mode="Transport">
<transport clientCredentialType="Basic"/>
<message clientCredentialType="UserName"/>
</security>
</binding>
<endpoint address="https://xxxxxxx.com/api/xxxxxxxxx" binding="basicHttpBinding" bindingConfiguration="ServiceSoap" contract="AkbankTestSW.ServiceSoap" name="ServiceSoap" />
这是客户端代码;
ServiceSoapClient client= new ServiceSoapClient();
client.ClientCredentials.UserName.UserName = "xxxxxxx";
client.ClientCredentials.UserName.Password = "xxxxxxxx";
ServicePointManager.SecurityProtocol = SecurityProtocolType.Tls | SecurityProtocolType.Tls11 | SecurityProtocolType.Tls12 | SecurityProtocolType.Ssl3;
//参数包括用户名和密码
try
{
var resp= onlineDBS.LimitSorgu(params);
}
catch (Exception ex)
{
ex.Message.ToString();
}
版权声明:本文内容由互联网用户自发贡献,该文观点与技术仅代表作者本人。本站仅提供信息存储空间服务,不拥有所有权,不承担相关法律责任。如发现本站有涉嫌侵权/违法违规的内容, 请发送邮件至 dio@foxmail.com 举报,一经查实,本站将立刻删除。