{"id":132,"date":"2006-07-25T15:48:58","date_gmt":"2006-07-25T22:48:58","guid":{"rendered":"http:\/\/kennyw.com\/indigo\/132"},"modified":"2006-07-25T15:48:58","modified_gmt":"2006-07-25T22:48:58","slug":"washing-the-soap-from-messages","status":"publish","type":"post","link":"https:\/\/kennyw.com\/?p=132","title":{"rendered":"Washing the SOAP from Messages"},"content":{"rendered":"<p>Now that the July CTP is public, I can divulge the details of a <a href=\"http:\/\/hyperthink.net\/blog\/2006\/04\/12\/Checkin+1383521.aspx\">feature that I added to WCF in April<\/a>.<\/p>\n<p>In PDC &#8217;05 we showed how you can use WCF extensibility to send &#8220;POX&#8221; (Plain Old Xml) Messages via our runtime.  However, it took some magical incantations to enable.  These including setting <code class=\"classname\"><a href=\"http:\/\/blogs.msdn.com\/drnick\/archive\/2006\/03\/09\/546940.aspx\">HttpMappingMode<\/a><\/code> on the <code class=\"classname\">HttpTransportBindingElement<\/code>, and writing a custom encoder that only writes out the body of the Message.<\/p>\n<p>In July CTP, you now get 1st class support for POX-style Messages.  To accomplish this, we added new Addressing and Envelope Versions (<code class=\"classname\">AddressingVersion<\/code><code>.None<\/code> and <code class=\"classname\">EnvelopeVersion<\/code><code>.None<\/code>).  I&#8217;m also happy to report the obsolescence and removal of <code class=\"classname\">HttpMappingMode<\/code> (nee <code>MapAddressingHeadersToHttpHeaders<\/code> for those former Beta 1 users who have been following along).<\/p>\n<p><code class=\"classname\">AddressingVersion<\/code><code>.None<\/code> means that your addressing information (To, Action, etc) is transmitted out of band from the Envelope. One example of this type of addressing is BasicHttpBinding &#8212; the <code>&lt;To&gt;<\/code> is sent as the HTTP Request-Uri, and the <code>&lt;Action&gt;<\/code> is sent out as either the SOAP-Action (in SOAP 1.1), or as a parameter to the content-type (in SOAP 1.2).  If a particular binding requires WS-Addressing, then they can throw on <code>Send()<\/code> for Messages with <code class=\"classname\">AddressingVersion<\/code><code>.None<\/code><\/p>\n<p><code class=\"classname\">EnvelopeVersion<\/code> applies to the basic structure of the Message. This is where SOAP can come in to play.  By default, the EnvelopeVersion of a Message is <code class=\"classname\">EnvelopeVersion<\/code><code>.Soap12<\/code>.  SOAP 1.2 includes (among other things), support for Headers, and an outer <code>&lt;Envelope&gt;<\/code> tag. To &#8220;wash off&#8221; the SOAP from the Message (thanks <a href=\"http:\/\/pluralsight.com\/blogs\/dbox\">Don<\/a>), you should create a Message with <code class=\"classname\">EnvelopeVersion<\/code><code>.None<\/code>.  When using such Messages, you cannot add any Headers other than <code>&lt;To&gt;<\/code> and <code>&lt;Action&gt;<\/code>.  <code>&lt;To&gt;<\/code> and <code>&lt;Action&gt;<\/code> are &#8220;special&#8221; since they are intrinsics used by the runtime system. <code>&lt;To&gt;<\/code> is used by default for addressing dispatch, and <code>&lt;Action&gt;<\/code> is used by default for Operation dispatch.  Some transports (such as our HTTP Transport) will strip these header values out and lift them into their &#8220;framing layer&#8221; (i.e. the goo we put around a Message to conform to the HTTP protocol).<\/p>\n<p>For our programming model, <code class=\"classname\">AddressingVersion<\/code> and <code class=\"classname\">EnvelopeVersion<\/code> are packaged together into a single <code class=\"classname\">MessageVersion<\/code> that is assigned to a <code class=\"classname\">Message<\/code> or a <code class=\"classname\">Binding<\/code>.  Enabling simple POX messaging is now simply a matter of setting up an HTTP binding on your service with a TextEncoder that uses <code class=\"classname\">MessageVersion<\/code><code>.None<\/code> (or messageVersion=&#8221;none&#8221; in config-speak).  Viola! No SOAP!<\/p>\n<p>NOTE: see <a href=\"http:\/\/wcf.netfx3.com\/content\/BreakingChangesbetweenVistaBeta2andJuneCTP.aspx\">here<\/a> for more information about the breaking changes between Beta 2 and the June CTP.<\/p>\n","protected":false},"excerpt":{"rendered":"<p>Now that the July CTP is public, I can divulge the details of a feature that I added to WCF in April. In PDC &#8217;05 we showed how you can use WCF extensibility to send &#8220;POX&#8221; (Plain Old Xml) Messages via our runtime. However, it took some magical incantations to enable. These including setting HttpMappingMode [&hellip;]<\/p>\n","protected":false},"author":2,"featured_media":0,"comment_status":"open","ping_status":"open","sticky":false,"template":"","format":"standard","meta":{"footnotes":""},"categories":[11],"tags":[],"class_list":["post-132","post","type-post","status-publish","format-standard","hentry","category-indigo"],"_links":{"self":[{"href":"https:\/\/kennyw.com\/index.php?rest_route=\/wp\/v2\/posts\/132","targetHints":{"allow":["GET"]}}],"collection":[{"href":"https:\/\/kennyw.com\/index.php?rest_route=\/wp\/v2\/posts"}],"about":[{"href":"https:\/\/kennyw.com\/index.php?rest_route=\/wp\/v2\/types\/post"}],"author":[{"embeddable":true,"href":"https:\/\/kennyw.com\/index.php?rest_route=\/wp\/v2\/users\/2"}],"replies":[{"embeddable":true,"href":"https:\/\/kennyw.com\/index.php?rest_route=%2Fwp%2Fv2%2Fcomments&post=132"}],"version-history":[{"count":0,"href":"https:\/\/kennyw.com\/index.php?rest_route=\/wp\/v2\/posts\/132\/revisions"}],"wp:attachment":[{"href":"https:\/\/kennyw.com\/index.php?rest_route=%2Fwp%2Fv2%2Fmedia&parent=132"}],"wp:term":[{"taxonomy":"category","embeddable":true,"href":"https:\/\/kennyw.com\/index.php?rest_route=%2Fwp%2Fv2%2Fcategories&post=132"},{"taxonomy":"post_tag","embeddable":true,"href":"https:\/\/kennyw.com\/index.php?rest_route=%2Fwp%2Fv2%2Ftags&post=132"}],"curies":[{"name":"wp","href":"https:\/\/api.w.org\/{rel}","templated":true}]}}