我创建了控制台应用程序以使用Web服务。调用该Web服务时出现以下异常
传入消息的信封版本(Soap11(http://schemas.xmlsoap.org/soap/envelope/))与编码器的信封版本(Soap12(http://www.w3.org/2003/05/soap-envelope))不匹配。请确保使用与预期消息相同的版本配置绑定。
这是我的配置。你能帮我解决这个问题吗?
<wsHttpBinding>
<binding name="SecurityDemo">
<security mode="Transport">
<transport clientCredentialType="Certificate" />
</security>
</binding>
</wsHttpBinding>
<endpoint name="endpointname"
address="URL"
binding="wsHttpBinding" bindingConfiguration="SecurityDemo"
contract="contractname" />
2条答案
按热度按时间q43xntqr1#
通过采用wsHttpBinding,您基本上是在强迫客户端使用Soap12。将其更改为BasicHttpBinding,看看是否会得到不同的结果,如果不需要Soap12特性,则保留它。更多详细信息可以在here中找到
vs3odd8k2#
在.NET 6中,我可以做到这一点: