我试图弄清楚如何从.NET调用Java Web服务(黑盒子),希望每个请求都使用证书进行签名(这没有问题)。
我不明白。无论我尝试什么,都会失败。花了几个小时进行研究和测试后,我认为正确的方法应该是使用customBinding而不是basicHttpBinding。我想要实现的是签名标题以及消息正文。
通过使用身份验证模式 CertificateOverTransport ,只会对SOAP标头进行签名,而不是正文。通过使用身份验证模式 MutualCertificate ,所有内容都经过签名和加密。
我是否有机会禁用整条消息的加密?
答案 0 :(得分:3)
我明白了。
结合:
<?xml version="1.0" encoding="utf-8" ?>
<configuration>
<system.serviceModel>
<bindings>
<customBinding>
<binding name="FFB">
<context protectionLevel="Sign" />
<textMessageEncoding messageVersion="Soap11" />
<security authenticationMode="MutualCertificateDuplex" includeTimestamp="true" />
<httpsTransport />
</binding>
</customBinding>
</bindings>
</system.serviceModel>
</configuration>
另外:
service.Endpoint.Contract.ProtectionLevel = ProtectionLevel.Sign;