<?xml version="1.0" encoding="UTF-8"?><rss version="2.0"
	xmlns:content="http://purl.org/rss/1.0/modules/content/"
	xmlns:dc="http://purl.org/dc/elements/1.1/"
	xmlns:atom="http://www.w3.org/2005/Atom"
	xmlns:sy="http://purl.org/rss/1.0/modules/syndication/"
		>
<channel>
	<title>Comments on: REST/POX client with WCF</title>
	<atom:link href="http://www.manas.com.ar/waj/2007/05/13/rest-pox-client-with-wcf/feed/" rel="self" type="application/rss+xml" />
	<link>http://www.manas.com.ar/waj/2007/05/13/rest-pox-client-with-wcf/</link>
	<description>Thinking code</description>
	<lastBuildDate>Wed, 25 Jan 2012 15:29:11 +0000</lastBuildDate>
	<sy:updatePeriod>hourly</sy:updatePeriod>
	<sy:updateFrequency>1</sy:updateFrequency>
	<generator>http://wordpress.org/?v=3.3.1</generator>
	<item>
		<title>By: Flowing Identity from a Client to a Service when using RESTful WCF Part 2 - A Solution &#124; The Freak Parade</title>
		<link>http://www.manas.com.ar/waj/2007/05/13/rest-pox-client-with-wcf/#comment-52</link>
		<dc:creator>Flowing Identity from a Client to a Service when using RESTful WCF Part 2 - A Solution &#124; The Freak Parade</dc:creator>
		<pubDate>Thu, 04 Sep 2008 15:19:55 +0000</pubDate>
		<guid isPermaLink="false">http://www.manas.com.ar/waj/?p=14#comment-52</guid>
		<description>[...] post will describe a technique to transparently insert a custom HTTP header into all requests generated by a WCF REST proxy, as well as a technique to extract that HTTP header from the request [...] </description>
		<content:encoded><![CDATA[<p>[...] post will describe a technique to transparently insert a custom HTTP header into all requests generated by a WCF REST proxy, as well as a technique to extract that HTTP header from the request [...]</p>
]]></content:encoded>
	</item>
	<item>
		<title>By: Juan Wajnerman &#187; REST/POX client with WCF 3.5</title>
		<link>http://www.manas.com.ar/waj/2007/05/13/rest-pox-client-with-wcf/#comment-51</link>
		<dc:creator>Juan Wajnerman &#187; REST/POX client with WCF 3.5</dc:creator>
		<pubDate>Sat, 01 Dec 2007 21:56:13 +0000</pubDate>
		<guid isPermaLink="false">http://www.manas.com.ar/waj/?p=14#comment-51</guid>
		<description>[...] time ago I wrote a post about how to create REST clients using WCF and taking advantage of its extensibility to obtain a [...] </description>
		<content:encoded><![CDATA[<p>[...] time ago I wrote a post about how to create REST clients using WCF and taking advantage of its extensibility to obtain a [...]</p>
]]></content:encoded>
	</item>
	<item>
		<title>By: Matt</title>
		<link>http://www.manas.com.ar/waj/2007/05/13/rest-pox-client-with-wcf/#comment-50</link>
		<dc:creator>Matt</dc:creator>
		<pubDate>Sat, 03 Nov 2007 05:30:18 +0000</pubDate>
		<guid isPermaLink="false">http://www.manas.com.ar/waj/?p=14#comment-50</guid>
		<description>Some more info that i forgot to add.  I am simulating a client POST request by using fiddler to send xml data in the request body.  I always get the same response:
HTTP/1.1 415 Unsupported Media Type

I&#039;ve tried setting the RequestFormat in the WebInvoke Attribute as RequestFormat=WebMessageFormat.Xml

but that didnt make any difference.
Thanks

Matt</description>
		<content:encoded><![CDATA[<p>Some more info that i forgot to add.  I am simulating a client POST request by using fiddler to send xml data in the request body.  I always get the same response:<br />
HTTP/1.1 415 Unsupported Media Type</p>
<p>I&#8217;ve tried setting the RequestFormat in the WebInvoke Attribute as RequestFormat=WebMessageFormat.Xml</p>
<p>but that didnt make any difference.<br />
Thanks</p>
<p>Matt</p>
]]></content:encoded>
	</item>
	<item>
		<title>By: Matt</title>
		<link>http://www.manas.com.ar/waj/2007/05/13/rest-pox-client-with-wcf/#comment-49</link>
		<dc:creator>Matt</dc:creator>
		<pubDate>Sat, 03 Nov 2007 05:26:27 +0000</pubDate>
		<guid isPermaLink="false">http://www.manas.com.ar/waj/?p=14#comment-49</guid>
		<description>Hi Juan,
I&#039;ve spent all day trying to figure out how to parse xml data that I am posting to my wcf service.

Here is what the operation contract looks like
    [OperationContract, WebInvoke]
    XmlElement GetAsXml();

I want to parse the xml that is included in the Post Request Body.
Any ideas on how I would do that.</description>
		<content:encoded><![CDATA[<p>Hi Juan,<br />
I&#8217;ve spent all day trying to figure out how to parse xml data that I am posting to my wcf service.</p>
<p>Here is what the operation contract looks like<br />
    [OperationContract, WebInvoke]<br />
    XmlElement GetAsXml();</p>
<p>I want to parse the xml that is included in the Post Request Body.<br />
Any ideas on how I would do that.</p>
]]></content:encoded>
	</item>
	<item>
		<title>By: Greg Sokalski</title>
		<link>http://www.manas.com.ar/waj/2007/05/13/rest-pox-client-with-wcf/#comment-48</link>
		<dc:creator>Greg Sokalski</dc:creator>
		<pubDate>Tue, 02 Oct 2007 17:08:30 +0000</pubDate>
		<guid isPermaLink="false">http://www.manas.com.ar/waj/?p=14#comment-48</guid>
		<description>Thanks Greg. 
So my requirement is to have a WCF service that my internal .NET apps can call and pass in an object graph that the service needs to deserialize into xml and post it to another external RESTful service which in turn will send me reply xml then I would need to serialize and send back to the consumer.

I&#039;m assuming, correct me if I&#039;m wrong, I construct a normal WCF service with a defined service and data contracts. Tnen inside my service contract, I would need to deserialize the data into xml (1. any place this should be done or just simply inside the business logic?). Once I have the raw xml, I can then utilize my custom RestPoxBehavior while calling the RESTful service, where inside of it (like yours), I set the method to POST, SuppressEntityBody to true (2. what do I do with headers, properties? I don&#039;t really understand that part). Then in the SerializeRequest, I use my custom BodyWriter (3. a. do I simply create a message with my raw xml? b. do I set any specific Message properties?). 
Lastly, in the DeserializeReply, 4. is that the place where I deserialize the xml received from the ReSTful service?

I apologize if any questions seem odd but I&#039;m new and hopefully you can guide me in the right direction.

Appreciate your help.</description>
		<content:encoded><![CDATA[<p>Thanks Greg.<br />
So my requirement is to have a WCF service that my internal .NET apps can call and pass in an object graph that the service needs to deserialize into xml and post it to another external RESTful service which in turn will send me reply xml then I would need to serialize and send back to the consumer.</p>
<p>I&#8217;m assuming, correct me if I&#8217;m wrong, I construct a normal WCF service with a defined service and data contracts. Tnen inside my service contract, I would need to deserialize the data into xml (1. any place this should be done or just simply inside the business logic?). Once I have the raw xml, I can then utilize my custom RestPoxBehavior while calling the RESTful service, where inside of it (like yours), I set the method to POST, SuppressEntityBody to true (2. what do I do with headers, properties? I don&#8217;t really understand that part). Then in the SerializeRequest, I use my custom BodyWriter (3. a. do I simply create a message with my raw xml? b. do I set any specific Message properties?).<br />
Lastly, in the DeserializeReply, 4. is that the place where I deserialize the xml received from the ReSTful service?</p>
<p>I apologize if any questions seem odd but I&#8217;m new and hopefully you can guide me in the right direction.</p>
<p>Appreciate your help.</p>
]]></content:encoded>
	</item>
	<item>
		<title>By: jwajnerman</title>
		<link>http://www.manas.com.ar/waj/2007/05/13/rest-pox-client-with-wcf/#comment-47</link>
		<dc:creator>jwajnerman</dc:creator>
		<pubDate>Sat, 29 Sep 2007 17:39:08 +0000</pubDate>
		<guid isPermaLink="false">http://www.manas.com.ar/waj/?p=14#comment-47</guid>
		<description>Greg, basically you have to return a non empty Message from SerializeRequest method. You can use other overloads of Message.CreateMessage for that. For example, creating a custom BodyWriter.
Apart from that you just have to change the verb and set the SuppressEntityBody to &#039;true&#039; in the BeforeSendRequest method and you are done.
Then you&#039;ll have to think about how to make it more flexible and support either GET or POST requests, how to specify it. For example you can parse the Action to be something like &quot;GET /foor&quot; or &quot;POST /bar&quot;. Also, if you want to mix query string arguments with request body, which argument(s) will be used for the body and which ones for the query string? You can assume the first one for the body, or use attributes, etc... All this stuff depends on your requirements and your creativity ;-).</description>
		<content:encoded><![CDATA[<p>Greg, basically you have to return a non empty Message from SerializeRequest method. You can use other overloads of Message.CreateMessage for that. For example, creating a custom BodyWriter.<br />
Apart from that you just have to change the verb and set the SuppressEntityBody to &#8216;true&#8217; in the BeforeSendRequest method and you are done.<br />
Then you&#8217;ll have to think about how to make it more flexible and support either GET or POST requests, how to specify it. For example you can parse the Action to be something like &#8220;GET /foor&#8221; or &#8220;POST /bar&#8221;. Also, if you want to mix query string arguments with request body, which argument(s) will be used for the body and which ones for the query string? You can assume the first one for the body, or use attributes, etc&#8230; All this stuff depends on your requirements and your creativity <img src='http://www.manas.com.ar/wp-includes/images/smilies/icon_wink.gif' alt=';-)' class='wp-smiley' /> .</p>
]]></content:encoded>
	</item>
	<item>
		<title>By: Greg Sojalski</title>
		<link>http://www.manas.com.ar/waj/2007/05/13/rest-pox-client-with-wcf/#comment-46</link>
		<dc:creator>Greg Sojalski</dc:creator>
		<pubDate>Thu, 20 Sep 2007 18:16:08 +0000</pubDate>
		<guid isPermaLink="false">http://www.manas.com.ar/waj/?p=14#comment-46</guid>
		<description>Juan,
Great article. 

So if one had to do a post of a large xml doc to a REST service, what modifications does one have to make to this code? Obviously changing a GET to a POST, but how does SerializeRequest change? Any details or info would be greatly appreciated.</description>
		<content:encoded><![CDATA[<p>Juan,<br />
Great article. </p>
<p>So if one had to do a post of a large xml doc to a REST service, what modifications does one have to make to this code? Obviously changing a GET to a POST, but how does SerializeRequest change? Any details or info would be greatly appreciated.</p>
]]></content:encoded>
	</item>
	<item>
		<title>By: Frank-Leonardo Quednau</title>
		<link>http://www.manas.com.ar/waj/2007/05/13/rest-pox-client-with-wcf/#comment-45</link>
		<dc:creator>Frank-Leonardo Quednau</dc:creator>
		<pubDate>Wed, 08 Aug 2007 09:20:28 +0000</pubDate>
		<guid isPermaLink="false">http://www.manas.com.ar/waj/?p=14#comment-45</guid>
		<description>Hi Juan,
I wasn&#039;t even sure my comment got through, as your underlying DB didn&#039;t respond that day...anyway, back then I found the necessary step by writing an encoder and got it working...hence no need to POST XML with WCF! So far I have only documented the web sites I came across, but I will be writing about the Text Encoder business in the days to come on my site. Thanks again for your helpful post!</description>
		<content:encoded><![CDATA[<p>Hi Juan,<br />
I wasn&#8217;t even sure my comment got through, as your underlying DB didn&#8217;t respond that day&#8230;anyway, back then I found the necessary step by writing an encoder and got it working&#8230;hence no need to POST XML with WCF! So far I have only documented the web sites I came across, but I will be writing about the Text Encoder business in the days to come on my site. Thanks again for your helpful post!</p>
]]></content:encoded>
	</item>
	<item>
		<title>By: Juan Wajnerman</title>
		<link>http://www.manas.com.ar/waj/2007/05/13/rest-pox-client-with-wcf/#comment-44</link>
		<dc:creator>Juan Wajnerman</dc:creator>
		<pubDate>Thu, 19 Jul 2007 00:58:56 +0000</pubDate>
		<guid isPermaLink="false">http://www.manas.com.ar/waj/?p=14#comment-44</guid>
		<description>Frank, in order to customize the POST content, you should create a custom MessageEncoder. The message encoder is responsible of serialize the message on the wire.
In fact, what you have in the message is the XML infoset. That is an abstract representation of the objects, and that is created by the message formatters.
So, the big picture can be something like this:
typed object &gt;-- FORMATTER --&gt; message (xml infoset) &gt;-- ENCODER --&gt; XML or any other representation
At the same time, remember that the output of the encoder should be supported and will be encapsulated by the transport channel. In the case of a http transport, that means the body of the http request.

Hope you find this useful.
Thanks for reading!

Juan</description>
		<content:encoded><![CDATA[<p>Frank, in order to customize the POST content, you should create a custom MessageEncoder. The message encoder is responsible of serialize the message on the wire.<br />
In fact, what you have in the message is the XML infoset. That is an abstract representation of the objects, and that is created by the message formatters.<br />
So, the big picture can be something like this:<br />
typed object >&#8211; FORMATTER &#8211;> message (xml infoset) >&#8211; ENCODER &#8211;> XML or any other representation<br />
At the same time, remember that the output of the encoder should be supported and will be encapsulated by the transport channel. In the case of a http transport, that means the body of the http request.</p>
<p>Hope you find this useful.<br />
Thanks for reading!</p>
<p>Juan</p>
]]></content:encoded>
	</item>
	<item>
		<title>By: Frank-Leonardo Quednau</title>
		<link>http://www.manas.com.ar/waj/2007/05/13/rest-pox-client-with-wcf/#comment-43</link>
		<dc:creator>Frank-Leonardo Quednau</dc:creator>
		<pubDate>Wed, 18 Jul 2007 14:04:25 +0000</pubDate>
		<guid isPermaLink="false">http://www.manas.com.ar/waj/?p=14#comment-43</guid>
		<description>Greetings!
I enjoyed reading through your item and your project works well. I have been looking into setting up something similar with facebook. 

However, I am quite stuck with the fact that most requests need to be POSTed. That in itself may be alright, but the body sent has nothing to do with XML. Wherever I look at WCF&#039;s body properties I hit XMlSerializers and similar objects. Do you think there is any way to send a message whose body is not XML?</description>
		<content:encoded><![CDATA[<p>Greetings!<br />
I enjoyed reading through your item and your project works well. I have been looking into setting up something similar with facebook. </p>
<p>However, I am quite stuck with the fact that most requests need to be POSTed. That in itself may be alright, but the body sent has nothing to do with XML. Wherever I look at WCF&#8217;s body properties I hit XMlSerializers and similar objects. Do you think there is any way to send a message whose body is not XML?</p>
]]></content:encoded>
	</item>
</channel>
</rss>

