Is it possible to determine a WCF binding configuration from the SOAP envelope?

杀马特。学长 韩版系。学妹 提交于 2019-11-29 15:25:40

Use this custom binding:

<customBinding>
        <binding name="NewBinding0">
            <textMessageEncoding messageVersion="Soap11" />
            <security authenticationMode="MutualCertificate" includeTimestamp="false"
                messageSecurityVersion="WSSecurity10WSTrustFebruary2005WSSecureConversationFebruary2005WSSecurityPolicy11BasicSecurityProfile10">
                <secureConversationBootstrap />
            </security>
            <httpTransport />
        </binding>
</customBinding>

make sure to decorate your contract to sign only:

[System.ServiceModel.ServiceContractAttribute(ConfigurationName=..., ProtectionLevel=System.Net.Security.ProtectionLevel.Sign)]

you will need to configure a service certificate in addition to a client certificate. You (probably) don't have such certificate which is ok, just configure any dummy certificate there (even same one as client).

See this link for more possible error resolution with this scenario.

易学教程内所有资源均来自网络或用户发布的内容,如有违反法律规定的内容欢迎反馈
该文章没有解决你所遇到的问题?点击提问,说说你的问题,让更多的人一起探讨吧!