Does WCF support WS-Security with SOAP 1.1?

不打扰是莪最后的温柔 提交于 2019-11-27 14:09:21

In order to use WS-Addressing (wsHttpBinding), but with SOAP 1.1 (SOAP 1.2 being the default), you need to define a custom WCF binding (e.g. in config) and use that:

<bindings>
   <customBinding>
      <binding name="WsHttpSoap11" >
         <textMessageEncoding messageVersion="Soap11WSAddressing10" />
         <httpTransport/>
      </binding>
   </customBinding>
</bindings>

and then in your endpoint definition, use:

<endpoint name="WsSoap11"
    address="....."
    binding="customBinding"
    bindingConfiguration="wsHttpSoap11"
    contract="....." />

Of course, you can extend the custom binding defined above with additional properties, e.g. <reliableMessaging> or others.

For more very detailed, very useful info on WCF bindings and how to "compose" your own custom bindings in config, read this excellent MSDN article Service Station: WCF Bindings In Depth by Aaron Skonnard.

You must either use BasicHttpBinding which also supports TransportWithMessageCredentials (SOAP 1.1 + HTTPS + WS-Security X.509 Certificate Token profile) or create custom binding based on all your needs.

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