开发者

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开发者_JS百科 able to change it.


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

0

上一篇:

下一篇:

精彩评论

暂无评论...
验证码 换一张
取 消

最新问答

问答排行榜