IT:AD:WCF:HowTo:Choose the Right Binding messageVersion
Summary
For most new http based WCF communications these days one would choose wsHttpBinding, using Soap1.2
But to connect – or emulate – older SOAP 1.1 bindings, one has to know a bit more about the messageVersion attribute.
Notes
You set the messageVersion attribute as follows:
<system.serviceModel>
<behaviors>
<!-- add default (no-name) serviceBehavior to allow meta-->
<serviceBehaviors>
<behavior name="">
<serviceMetadata httpGetEnabled="true" httpsGetEnabled="true" />
<serviceDebug includeExceptionDetailInFaults="true" />
</behavior>
</serviceBehaviors>
</behaviors>
<bindings>
<customBinding>
<binding name="WsHttpSoap11" >
<textMessageEncoding messageVersion="Soap11" />
<httpTransport/>
</binding>
</customBinding>
</bindings>
<services>
<service name="App.Legacy.API.Soap.SOAP_2SoapPort">
<endpoint
binding="customBinding"
bindingConfiguration="WsHttpSoap11"
contract="ISOAP_2SoapPort"
/>
</service>
</services>
</system.serviceModel>
The messageVersion can be set to any of:
- None - No SOAP, just Plan Old XML.
- Soap11 - Uses SOAP 1.1.
- Soap12 - Uses SOAP 1.2.
- Soap11WSAddressing10 - Uses SOAP 1.1 and W3C Recommendation WS-Addressing 1.0 - Core
- Soap12WSAddressing10 - Uses SOAP 1.2 and W3C Recommendation WS-Addressing 1.0 - Core
- Soap11WSAddressingAugust2004 - Uses SOAP 1.1 and the legacy W3C submission for WS-Addressing. This is the same version of WS-Addressing that WSE 3.0 uses, and is included for wire-level interop between WSE 3.0 and WCF.
- Soap12WSAddressingAugust2004 - Uses SOAP 1.1 and the legacy W3C submission for WS-Addressing. This is the same version of WS-Addressing that WSE 3.0 uses, and is included for wire-level interop between WSE 3.0 and WCF.