![](/img/trans.png)
[英]SOAP WCF add Signature and BinarySecurityToken to header
[英]Stop WCF From Adding A Signature To The SOAP Header
我在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
元素,您实际上将事物设置为仅传输安全性。 在仅传输模式下,不添加任何签名。
可悲的是,缺少的一件事是时间戳。 我找不到会添加时间戳的配置-因此我必须手动添加。 与使所有其他东西正常工作相比,这是微不足道的,所以说实话,我很高兴这样做。
声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.