Bogi
Bogi

Reputation: 2618

BasicHttpBinding and MessageVersion.None

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.

Upvotes: 2

Views: 6389

Answers (1)

marc_s
marc_s

Reputation: 755321

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

Upvotes: 3

Related Questions