views:

119

answers:

1

How to configure XML web services client to use MessageVersion.Soap11WSAddressing10 for header namespaces. Currently it uses MessageVersion.None namespace, without me able to change it.

+1  A: 

You need to do this using a custom WCF binding:

  <system.serviceModel>
    <bindings>
      <customBinding>
        <binding name="Soap11Addr10">
          <textMessageEncoding messageVersion="Soap11WSAddressing10" />
          <httpTransport/>
        </binding>
      </customBinding>
    </bindings>

and then reference that custom binding (by name) in your service endpoint:

    <services>
      <service name="YourAssembly.YourService">
        <endpoint name="test"
                  address=""
                  binding="customBinding"
                  bindingConfiguration="Soap11Addr10"
                  contract="YourAssembly.IYourService" />
      </service>
    </services>
  </system.serviceModel>

If you want to use this from a client, you also need to copy the custom binding configuration to the client's app.config or web.config and reference it there, of course (using Add Service Reference in Visual Studio will do this for you).

marc_s
That is the solution, but still I don't understand why microsoft is saying basichttpbinding is compatible with WS-Basic Profile 1.1, and one can not set to use MessageVersion.Soap11Addr10
Bogi
That answer only Microsoft can provide.....
marc_s