我正在尝试弄清楚如何从 .NET 调用 Java Web 服务(黑盒),它希望每个请求都使用证书签名(这没问题)。
我不明白。无论我尝试什么,它都会失败。在花费数小时研究和测试后,我认为正确的方法应该是使用 customBinding 而不是 basicHttpBinding。我想要实现的是对 header 和消息正文进行签名。
通过使用身份验证模式 CertificateOverTransport 仅对 SOAP header 进行签名,而不对正文进行签名。通过使用身份验证模式 MutualCertificate 对所有内容进行签名和加密。
我是否有机会禁用对整个消息的加密?
最佳答案
我明白了。
绑定(bind):
<?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;
关于java - Web 服务自定义绑定(bind) - 签署 SOAP header 和消息,但不加密,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/7193379/