Warning: file_get_contents(/data/phpspider/zhask/data//catemap/2/csharp/258.json): failed to open stream: No such file or directory in /data/phpspider/zhask/libs/function.php on line 167

Warning: Invalid argument supplied for foreach() in /data/phpspider/zhask/libs/tag.function.php on line 1116

Notice: Undefined index: in /data/phpspider/zhask/libs/function.php on line 180

Warning: array_chunk() expects parameter 1 to be array, null given in /data/phpspider/zhask/libs/function.php on line 181
C# 停止WCF向SOAP头添加签名_C#_Wcf_Soap - Fatal编程技术网

C# 停止WCF向SOAP头添加签名

C# 停止WCF向SOAP头添加签名,c#,wcf,soap,C#,Wcf,Soap,我已将ProtectionLevel=ProtectionLevel.None放在我的WCF客户端(调用SOAP服务)的ServiceContract上,但WCF仍在向标头添加签名 [ServiceContract(ConfigurationName = "IMyOutboundService", ProtectionLevel = ProtectionLevel.None)] 如何关闭此客户端的标头签名 我正在使用带有authenticationMode=“MutualCertificate

我已将
ProtectionLevel=ProtectionLevel.None
放在我的WCF客户端(调用SOAP服务)的
ServiceContract
上,但WCF仍在向标头添加签名

[ServiceContract(ConfigurationName = "IMyOutboundService", ProtectionLevel = ProtectionLevel.None)]
如何关闭此客户端的标头签名

我正在使用带有
authenticationMode=“MutualCertificate”
customBinding
,并且我已经设置了
。我可以使用不同的绑定,只要允许

以下是当前绑定的全部内容:

    <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头)


通过删除
我已经让这一个工作了,很难

    <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头)


到目前为止,通过删除
,我的研究表明,如果您使用的是“MutualCertificate”身份验证模式,则无法关闭签名。。。因此,如果有人知道这是否属实,那么这方面的确认或证据也会很有用!你能有一个SOAP监听器,截取消息并实际删除标题吗?我的意思是来自标题的签名来自回忆-perty如果你使用mutualcert,你必须对标题进行签名…否则我想你会说“我的邮件是经过签名/加密的,因此是可验证的,我的邮件头没有签名,因此不信任它…因此不信任它的邮件”我想你可以使用basicHttpBinding,或者使用MessageContract,并将ProtectionLevel放入[MessageHeader]中到目前为止,我的研究表明,如果您使用的是“相互认证”,则无法关闭签名“身份验证模式。。。因此,如果有人知道这是否属实,那么这方面的确认或证据也会很有用!你能有一个SOAP监听器,截取消息并实际删除标题吗?我的意思是来自标题的签名来自回忆-perty如果你使用mutualcert,你必须对标题进行签名…否则我想你会说“我的邮件是经过签名/加密的,因此是可验证的,我的邮件头没有签名,因此不信任它…因此不信任它的邮件”我认为您可以使用basicHttpBinding,或者可能使用MessageContract并将ProtectionLevel放入[MessageHeader]属性中。