WCF: How to apply ws-addressing

So I ran into a situation where I needed to apply ws-addressing and a specific SOAP version to a web service. How does one do this? Well, in short, you create a custom binding, bind your endpoint to it, then set the textMessageEncoding property. Here is the simplified config:


<?xml version="1.0" encoding="utf-8" ?>





                <binding name="BindingSoap12Address10">

                    <textMessageEncoding />

                    <httpTransport />


                <binding name="BindingSoap11Address10">

                    <textMessageEncoding messageVersion="Soap11WSAddressing10" />

                    <httpTransport />


                <binding name="BindingSoap11Address2004">

                    <textMessageEncoding messageVersion="Soap11WSAddressingAugust2004" />

                    <httpTransport />


                <binding name="BindingSoap12Address2004">

                    <textMessageEncoding messageVersion="Soap12WSAddressingAugust2004" />

                    <httpTransport />






                <behavior name="mexBehavior">

                    <serviceMetadata httpGetEnabled="true" httpGetUrl="metaData" />





            <service behaviorConfiguration="mexBehavior" name="WcfConsumer.MyService">

                <endpoint address="" binding="customBinding"


                          name="HttpSoap12Address2004" contract="WcfConsumer.IMyContract" />



                        <add baseAddress="http://localhost:2122/MyService" />








It’s a little more readable in the tool (C:Program FilesMicrosoft SDKsWindowsv6.0BinSvcConfigEditor.exe – part of the .NET 3.0 SDK, I think?):




Where MessageVersion has these for options:




Soap11 and SOAP 1.1 – and Addressing10 means ws-Addressing 1.0 where AddressingAugust2004 means the old 2004/08 standard. So obviously from this dropdown, you have the various combinations of which SOAP version and which ws-addressing version. There it is.

Posted in .NET 3.5, Uncategorized

Leave a Reply

Fill in your details below or click an icon to log in:

WordPress.com Logo

You are commenting using your WordPress.com account. Log Out /  Change )

Google+ photo

You are commenting using your Google+ account. Log Out /  Change )

Twitter picture

You are commenting using your Twitter account. Log Out /  Change )

Facebook photo

You are commenting using your Facebook account. Log Out /  Change )


Connecting to %s


Enter your email address to follow this blog and receive notifications of new posts by email.

Join 8 other followers

%d bloggers like this: