停止WCF向SOAP报头添加签名
本文关键字:添加 报头 SOAP WCF 停止 | 更新日期: 2023-09-27 17:50:27
我已经为我的WCF客户端(调用SOAP服务)在ServiceContract
上放置了ProtectionLevel = ProtectionLevel.None
,但是WCF仍在向标头添加签名。
[ServiceContract(ConfigurationName = "IMyOutboundService", ProtectionLevel = ProtectionLevel.None)]
如何关闭这个客户端的报头签名?
我使用customBinding
与authenticationMode="MutualCertificate"
,我已经设置了<textMessageEncoding messageVersion="Soap11WSAddressing10"/>
。我可以使用不同的绑定,只要允许。
下面是当前绑定的完整内容:
<binding name="MyBinding" openTimeout="00:00:10" sendTimeout="00:00:10" >
<textMessageEncoding messageVersion="Soap11WSAddressing10" />
<security authenticationMode="MutualCertificate"
includeTimestamp="true"
enableUnsecuredResponse="true">
<localClientSettings timestampValidityDuration="00:15:00"/>
</security>
<httpsTransport
manualAddressing="false" maxBufferPoolSize="524288"
maxReceivedMessageSize="5242880" allowCookies="false"
bypassProxyOnLocal="true" decompressionEnabled="true" hostNameComparisonMode="StrongWildcard"
keepAliveEnabled="true" maxBufferSize="5242880"
realm="" transferMode="Buffered" unsafeConnectionNtlmAuthentication="false"
useDefaultWebProxy="true" requireClientCertificate="true" />
</binding>
我已经得到了这个工作,艰难的方式!
<binding name="MyBinding" openTimeout="00:00:10" sendTimeout="00:00:10" >
<textMessageEncoding messageVersion="Soap11WSAddressing10" />
<httpsTransport
manualAddressing="false" maxBufferPoolSize="524288"
maxReceivedMessageSize="5242880" allowCookies="false"
bypassProxyOnLocal="true" decompressionEnabled="true" hostNameComparisonMode="StrongWildcard"
keepAliveEnabled="true" maxBufferSize="5242880"
realm="" transferMode="Buffered" unsafeConnectionNtlmAuthentication="false"
useDefaultWebProxy="true" requireClientCertificate="true" />
</binding>
因此,通过保持自定义绑定,而不是切换到基本绑定(我确实尝试过),您可以保留Soap11WSAddressing10(即您获得所有SOAP标头)。
通过删除<security
元素,基本上可以将内容设置为仅传输安全性。在仅传输模式下,不添加任何签名。