WCF Soap11 vs Soap11WSAddressing10 vs Soap11WSAddressingAugust2004 vs Soap12 vs Soap12WSAddressing10 vs Soap12WSAddressingAugust2004

By admin - Last updated: Sunday, February 22, 2009 - Save & Share - Leave a Comment

I’ve done some quick test on WCF interoperability of the SOAP versions and WSAddressing.

SOAP 1.1 vs SOAP 1.2

SOAP 1.2 is an extended version of SOAP 1.1, it does everything that SOAP 1.1 offers,
SOAP 1.2 provides clear processing model and it is based on XML infoset, it has no dependency on the underlying transport protocol. E.g. In SOAP 1.1, the SOAPAction field in HTTP header. The binding framework specifies the transport protocols, thus SOAP 1.2 is protocol independent. It also integrates well with HTTP protocol e.g. both HTTP GET and POST operations, this enables SOAP 1.2 can take the benefits of the existing web infrastructure. It has better support for web standard such as XML infoset, XML Base, XML schema 1.0 as well as internationalization.

WS-Addressing
Web service addressing specifies a method to include message routing information within SOAP message itself. Previously, it relies on transport protocol to present this information. By utilizing WS-Addressing, it decouples SOAP from HTTP protocols.

In the test WCF service, it exposes the test service with the following six endpoints, each endpoint is configured with the messageVersion accordingly.

The followings are captured requests/responses for each of the bindings,

Soap11
Pay attention to SOAPAction and Content-Type header in the request.

POST /WcfInterop/Service1.svc/soap11 HTTP/1.1
Content-Type: text/xml; charset=utf-8
SOAPAction: "http://tempuri.org/IService1/GetData"
Host: localhost:8000
Content-Length: 157
Expect: 100-continue

<s:Envelope xmlns:s="http://schemas.xmlsoap.org/soap/envelope/">
<s:Body>
<GetData xmlns="http://tempuri.org/">
<value>9</value>
</GetData>
</s:Body>
</s:Envelope>


HTTP/1.1 200 OK
Server: Microsoft-IIS/5.1
Date: Sun, 22 Feb 2009 05:27:24 GMT
X-Powered-By: ASP.NET
X-AspNet-Version: 2.0.50727
Cache-Control: private
Content-Type: text/xml; charset=utf-8

<s:Envelope xmlns:s="http://schemas.xmlsoap.org/soap/envelope/">
<s:Body>
<GetDataResponse xmlns="http://tempuri.org/">
<GetDataResult>
You entered: 9
</GetDataResult>
</GetDataResponse>
</s:Body>
</s:Envelope>

Soap11WSAddressing10
Pay attention to
SOAPAction and Content-Type header in the request.
a: prefix elements in the SOAP messages.

POST /WcfInterop/Service1.svc/Soap11WSAddressing10 HTTP/1.1
Content-Type: text/xml; charset=utf-8
SOAPAction: "http://tempuri.org/IService1/GetData"
Host: localhost:8000
Content-Length: 567
Expect: 100-continue

<s:Envelope xmlns:s="http://schemas.xmlsoap.org/soap/envelope/"
xmlns:a="http://www.w3.org/2005/08/addressing">

<s:Header>
<a:Action s:mustUnderstand="1">
http://tempuri.org/IService1/GetData</a:Action>
<a:MessageID>urn:uuid:95d97318-2dc8-470a-a3f3-4a927a57e6bd
</a:MessageID>
<a:ReplyTo>
<a:Address>
http://www.w3.org/2005/08/addressing/anonymous
</a:Address>
</a:ReplyTo>
<a:To s:mustUnderstand="1">
http://localhost:8000/WcfInterop/Service1.svc/Soap11WSAddressing10
</a:To>
</s:Header>
<s:Body>
<GetData xmlns="http://tempuri.org/">
<value>9</value>
</GetData>
</s:Body>
</s:Envelope>


HTTP/1.1 200 OK
Server: Microsoft-IIS/5.1
Date: Sun, 22 Feb 2009 05:27:58 GMT
X-Powered-By: ASP.NET
X-AspNet-Version: 2.0.50727
Cache-Control: private
Content-Type: text/xml; charset=utf-8
Content-Length: 428

<s:Envelope xmlns:s="http://schemas.xmlsoap.org/soap/envelope/"
xmlns:a="http://www.w3.org/2005/08/addressing">

<s:Header>
<a:Action s:mustUnderstand="1">
http://tempuri.org/IService1/GetDataResponse
</a:Action>
<a:RelatesTo>
urn:uuid:95d97318-2dc8-470a-a3f3-4a927a57e6bd
</a:RelatesTo>
</s:Header>
<s:Body>
<GetDataResponse xmlns="http://tempuri.org/">
<GetDataResult>You entered: 9</GetDataResult>
</GetDataResponse>
</s:Body>
</s:Envelope>

Soap11WSAddressingAugust2004
Pay attention to
SOAPAction and Content-Type header in the request.
a: prefix elements in the SOAP messages.

POST /WcfInterop/Service1.svc/Soap11WSAddressingAugust2004 HTTP/1.1
Content-Type: text/xml; charset=utf-8
SOAPAction: "http://tempuri.org/IService1/GetData"
Host: localhost:8000
Content-Length: 604
Expect: 100-continue

<s:Envelope xmlns:s="http://schemas.xmlsoap.org/soap/envelope/"
xmlns:a="http://schemas.xmlsoap.org/ws/2004/08/addressing">

<s:Header>
<a:Action s:mustUnderstand="1">
http://tempuri.org/IService1/GetData
</a:Action>
<a:MessageID>
urn:uuid:0f97a4d4-c709-4ec5-b478-54a8906b1e33
</a:MessageID>
<a:ReplyTo>
<a:Address>
http://schemas.xmlsoap.org/ws/2004/08/addressing/role/anonymous</a:Address>
</a:ReplyTo>
<a:To s:mustUnderstand="1">
http://localhost:8000/WcfInterop/Service1.svc/Soap11WSAddressingAugust2004
</a:To>
</s:Header>
<s:Body>
<GetData xmlns="http://tempuri.org/">
<value>9</value>
</GetData>
</s:Body>
</s:Envelope>



HTTP/1.1 200 OK
Server: Microsoft-IIS/5.1
Date: Sun, 22 Feb 2009 05:29:09 GMT
X-Powered-By: ASP.NET
X-AspNet-Version: 2.0.50727
Cache-Control: private
Content-Type: text/xml; charset=utf-8
Content-Length: 537

<s:Envelope xmlns:s="http://schemas.xmlsoap.org/soap/envelope/"
xmlns:a="http://schemas.xmlsoap.org/ws/2004/08/addressing">

<s:Header>
<a:Action s:mustUnderstand="1">
http://tempuri.org/IService1/GetDataResponse
</a:Action>
<a:RelatesTo>
urn:uuid:0f97a4d4-c709-4ec5-b478-54a8906b1e33
</a:RelatesTo>
<a:To s:mustUnderstand="1">
http://schemas.xmlsoap.org/ws/2004/08/addressing/role/anonymous
</a:To>
</s:Header>
<s:Body>
<GetDataResponse xmlns="http://tempuri.org/">
<GetDataResult>You entered: 9</GetDataResult>
</GetDataResponse>
</s:Body>
</s:Envelope>

Soap12
Pay attention to
SOAPAction and Content-Type header in the request.

POST /WcfInterop/Service1.svc/soap12 HTTP/1.1
Content-Type: application/soap+xml; charset=utf-8; action="http://tempuri.org/IService1/GetData"
Host: localhost:8000
Content-Length: 155
Expect: 100-continue

<s:Envelope xmlns:s="http://www.w3.org/2003/05/soap-envelope">
<s:Body>
<GetData xmlns="http://tempuri.org/">
<value>9</value>
</GetData>
</s:Body>
</s:Envelope>


HTTP/1.1 200 OK
Server: Microsoft-IIS/5.1
Date: Sun, 22 Feb 2009 05:30:32 GMT
X-Powered-By: ASP.NET
X-AspNet-Version: 2.0.50727
Cache-Control: private
Content-Type: application/soap+xml; charset=utf-8
Content-Length: 200

<s:Envelope xmlns:s="http://www.w3.org/2003/05/soap-envelope">
<s:Body>
<GetDataResponse xmlns="http://tempuri.org/">
<GetDataResult>You entered: 9</GetDataResult>
</GetDataResponse>
</s:Body>
</s:Envelope>

Soap12WSAddressing10
Pay attention to
SOAPAction and Content-Type header in the request.
a: prefix elements in the SOAP messages.

POST /WcfInterop/Service1.svc/Soap12WSAddressingAugust2004 HTTP/1.1
Content-Type: application/soap+xml; charset=utf-8
Host: localhost:8000
Content-Length: 602
Expect: 100-continue

<s:Envelope xmlns:s="http://www.w3.org/2003/05/soap-envelope"
xmlns:a="http://www.w3.org/2005/08/addressing">

<s:Header>
<a:Action s:mustUnderstand="1">
http://tempuri.org/IService1/GetData
</a:Action>
<a:MessageID>
urn:uuid:bd3cd912-7cb4-469e-a25f-ab5cff803432
</a:MessageID>
<a:ReplyTo>
<a:Address>
http://www.w3.org/2005/08/addressing/anonymous
</a:Address>
</a:ReplyTo>
<a:To s:mustUnderstand="1">
http://localhost:8000/WcfInterop/Service1.svc/Soap12WSAddressing10
</a:To>
</s:Header>
<s:Body>
<GetData xmlns="http://tempuri.org/">
<value>
9
</value>
</GetData>
</s:Body>
</s:Envelope>


HTTP/1.1 200 OK
Server: Microsoft-IIS/5.1
Date: Sun, 22 Feb 2009 05:31:08 GMT
X-Powered-By: ASP.NET
X-AspNet-Version: 2.0.50727
Cache-Control: private
Content-Type: application/soap+xml; charset=utf-8
Content-Length: 426

<s:Envelope xmlns:s="http://www.w3.org/2003/05/soap-envelope"
xmlns:a="http://www.w3.org/2005/08/addressing">

<s:Header>
<a:Action s:mustUnderstand="1">
http://tempuri.org/IService1/GetDataResponse
</a:Action>
<a:RelatesTo>urn:uuid:bd3cd912-7cb4-469e-a25f-ab5cff803432
</a:RelatesTo>
</s:Header>
<s:Body>
<GetDataResponse xmlns="http://tempuri.org/">
<GetDataResult>You entered: 9</GetDataResult>
</GetDataResponse>
</s:Body>
</s:Envelope>

Soap12WSAddressingAugust2004
Pay attention to
SOAPAction and Content-Type header in the request.
a: prefix elements in the SOAP messages.

POST /WcfInterop/Service1.svc/Soap12WSAddressingAugust2004 HTTP/1.1
Content-Type: application/soap+xml; charset=utf-8
Host: localhost:8000
Content-Length: 602
Expect: 100-continue

<s:Envelope xmlns:s="http://www.w3.org/2003/05/soap-envelope"
xmlns:a="http://schemas.xmlsoap.org/ws/2004/08/addressing">

<s:Header>
<a:Action s:mustUnderstand="1">
http://tempuri.org/IService1/GetData
</a:Action>
<a:MessageID>
urn:uuid:434e1c06-404b-42c5-9c72-cb6e4062a436
</a:MessageID>
<a:ReplyTo>
<a:Address>
http://schemas.xmlsoap.org/ws/2004/08/addressing/role/anonymous
</a:Address>
</a:ReplyTo>
<a:To s:mustUnderstand="1">
http://localhost:8000/WcfInterop/Service1.svc/Soap12WSAddressingAugust2004
</a:To>
</s:Header>
<s:Body>
<GetData xmlns="http://tempuri.org/">
<value>9</value>
</GetData>
</s:Body>
</s:Envelope>


HTTP/1.1 200 OK
Server: Microsoft-IIS/5.1
Date: Sun, 22 Feb 2009 05:32:19 GMT
X-Powered-By: ASP.NET
X-AspNet-Version: 2.0.50727
Cache-Control: private
Content-Type: application/soap+xml; charset=utf-8
Content-Length: 535

<s:Envelope xmlns:s="http://www.w3.org/2003/05/soap-envelope"

xmlns:a="http://schemas.xmlsoap.org/ws/2004/08/addressing">

<s:Header>
<a:Action s:mustUnderstand="1">
http://tempuri.org/IService1/GetDataResponse
</a:Action>
<a:RelatesTo>
urn:uuid:434e1c06-404b-42c5-9c72-cb6e4062a436
</a:RelatesTo>
<a:To s:mustUnderstand="1">
http://schemas.xmlsoap.org/ws/2004/08/addressing/role/anonymous
</a:To>
</s:Header>
<s:Body>
<GetDataResponse xmlns="http://tempuri.org/">
<GetDataResult>You entered: 9</GetDataResult>
</GetDataResponse>
</s:Body>
</s:Envelope>

Having the captured requests and responses SOAP along with the HTTP headers, you probably figure out the differences among different message versions. For more details about the SOAP versions and WS-Addressing, please refer to www.w3.org for the detailed specification.

Download solution used in this article




Posted in WCF • Tags: , , , , Top Of Page

Write a comment


Captcha: + five = 9