<?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 Services and Metadata Endpoints in WCF</title>
	<atom:link href="http://www.danrigsby.com/blog/index.php/2008/05/29/rest-services-and-metadata-endpoints-in-wcf/feed/" rel="self" type="application/rss+xml" />
	<link>http://www.danrigsby.com/blog/index.php/2008/05/29/rest-services-and-metadata-endpoints-in-wcf/</link>
	<description>Developer.Speaker.Blogger</description>
	<lastBuildDate>Sun, 14 Aug 2011 06:09:27 +0000</lastBuildDate>
	<generator>http://wordpress.org/?v=2.9</generator>
	<sy:updatePeriod>hourly</sy:updatePeriod>
	<sy:updateFrequency>1</sy:updateFrequency>
		<item>
		<title>By: Ivory tower protocol wars - Greg Beech&#39;s Tech Blog - Greg Beech's Website</title>
		<link>http://www.danrigsby.com/blog/index.php/2008/05/29/rest-services-and-metadata-endpoints-in-wcf/comment-page-1/#comment-816</link>
		<dc:creator>Ivory tower protocol wars - Greg Beech&#39;s Tech Blog - Greg Beech's Website</dc:creator>
		<pubDate>Tue, 26 Aug 2008 22:03:58 +0000</pubDate>
		<guid isPermaLink="false">http://www.danrigsby.com/blog/?p=231#comment-816</guid>
		<description>[...] compliant XML reader/writer, and you still have to construct and interpret the payloads. You lose the ability to self-document and thus the ability to automatically create proxies which mean you can&#039;t simply generate and [...]</description>
		<content:encoded><![CDATA[<p>[...] compliant XML reader/writer, and you still have to construct and interpret the payloads. You lose the ability to self-document and thus the ability to automatically create proxies which mean you can&#39;t simply generate and [...]</p>
]]></content:encoded>
	</item>
	<item>
		<title>By: Richard Ponton</title>
		<link>http://www.danrigsby.com/blog/index.php/2008/05/29/rest-services-and-metadata-endpoints-in-wcf/comment-page-1/#comment-765</link>
		<dc:creator>Richard Ponton</dc:creator>
		<pubDate>Thu, 14 Aug 2008 00:48:50 +0000</pubDate>
		<guid isPermaLink="false">http://www.danrigsby.com/blog/?p=231#comment-765</guid>
		<description>Gah.  Forgot to escape my &lt; and &gt; in my example.  Sorry.  I wish there was a preview post button.

The service contract:
&lt;code&gt;
        [OperationContract]
        [WebGet(UriTemplate = &quot;{addressBookId}?action=WipeOut&quot;)]
        System.IO.Stream StartWipeout(string addressBookId);

        // both the Get and the Invoke share the same UriTemplate
        [OperationContract]
        [WebInvoke(UriTemplate = &quot;{addressBookId}?action=WipeOut&quot;)]
        XElement DoWipeout(string addressBookId);
&lt;/code&gt;

The implementation:
&lt;code&gt;
public Stream StartWipeout(string addressBookId)
{
    MemoryStream ms = new MemoryStream();
    StreamWriter sw = new StreamWriter(ms, Encoding.UTF8);
    sw.Write(&quot;&lt;h1&gt;This will clear PDS and AddressBook data for &quot; + HttpUtility.HtmlEncode(addressBookId) + &quot;&lt;/h1&gt;&quot;);
    sw.Write(&quot;&lt;form method=&#039;POST&#039;&gt;&lt;input type=&#039;submit&#039; value=&#039;Do wipeout&#039; /&gt;&lt;/form&gt;&quot;);
    if (null != WebOperationContext.Current)
        WebOperationContext.Current.OutgoingResponse.ContentType = &quot;text/html&quot;;
    sw.Flush();

    ms.Position = 0;
    return ms;
}
public XElement DoWipeout(string addressBookId)
{
    WipeoutAddressBook(addressBookId);
    WipeoutPdsPrefs(addressBookId);
    return new XElement(&quot;WipedOut&quot;, addressBookId);
}&lt;/code&gt;</description>
		<content:encoded><![CDATA[<p>Gah.  Forgot to escape my &lt; and &gt; in my example.  Sorry.  I wish there was a preview post button.</p>
<p>The service contract:<br />
<code><br />
        [OperationContract]<br />
        [WebGet(UriTemplate = "{addressBookId}?action=WipeOut")]<br />
        System.IO.Stream StartWipeout(string addressBookId);</p>
<p>        // both the Get and the Invoke share the same UriTemplate<br />
        [OperationContract]<br />
        [WebInvoke(UriTemplate = "{addressBookId}?action=WipeOut")]<br />
        XElement DoWipeout(string addressBookId);<br />
</code></p>
<p>The implementation:<br />
<code><br />
public Stream StartWipeout(string addressBookId)<br />
{<br />
    MemoryStream ms = new MemoryStream();<br />
    StreamWriter sw = new StreamWriter(ms, Encoding.UTF8);<br />
    sw.Write("&lt;h1&gt;This will clear PDS and AddressBook data for " + HttpUtility.HtmlEncode(addressBookId) + "&lt;/h1&gt;");<br />
    sw.Write("&lt;form method='POST'&gt;&lt;input type='submit' value='Do wipeout' /&gt;&lt;/form&gt;");<br />
    if (null != WebOperationContext.Current)<br />
        WebOperationContext.Current.OutgoingResponse.ContentType = "text/html";<br />
    sw.Flush();</p>
<p>    ms.Position = 0;<br />
    return ms;<br />
}<br />
public XElement DoWipeout(string addressBookId)<br />
{<br />
    WipeoutAddressBook(addressBookId);<br />
    WipeoutPdsPrefs(addressBookId);<br />
    return new XElement("WipedOut", addressBookId);<br />
}</code></p>
]]></content:encoded>
	</item>
	<item>
		<title>By: Richard Ponton</title>
		<link>http://www.danrigsby.com/blog/index.php/2008/05/29/rest-services-and-metadata-endpoints-in-wcf/comment-page-1/#comment-764</link>
		<dc:creator>Richard Ponton</dc:creator>
		<pubDate>Thu, 14 Aug 2008 00:42:23 +0000</pubDate>
		<guid isPermaLink="false">http://www.danrigsby.com/blog/?p=231#comment-764</guid>
		<description>Hi Dan.  This post was recently of great use to me.  I used it for something slightly different.  Being a strong advocate of the &quot;HTTP GET should never be destructive&quot; philosophy, I like the fact that WCF will return &quot;method not allowed&quot; if you try and access a WebInvoke with GET.  However, some of my colleagues (especially those implementing REST services in perl) are in the habit if testing their services by typing URLs in their web browser and claim that requiring POST is too inconvenient.  To get the best of both worlds, I say you can have the GET return a form that does the POST.  Here&#039;s how to do it with WCF using your technique.

The service contract:
&lt;code&gt;
[OperationContract]
[WebGet(UriTemplate = &quot;WipeOut/user={userId}&quot;)]
System.IO.Stream StartWipeout(string userId);

// both the Get and the Invoke share the same UriTemplate
[OperationContract]
[WebInvoke(UriTemplate = &quot;WipeOut/user={userId}&quot;)]
XElement DoWipeout(string addressBookId);
&lt;/code&gt;

The implementation:
&lt;code&gt;
public Stream StartWipeout(string userId)
{
    MemoryStream ms = new MemoryStream();
    StreamWriter sw = new StreamWriter(ms, Encoding.UTF8);
    sw.Write(&quot;This will clear all data for &quot; + HttpUtility.HtmlEncode(userId) + &quot;&quot;);
    sw.Write(&quot;&quot;);
    if (null != WebOperationContext.Current)
        WebOperationContext.Current.OutgoingResponse.ContentType = &quot;text/html&quot;;
    sw.Flush();

    ms.Position = 0;
    return ms;
}
public XElement DoWipeout(string userId)
{
    // actually do the WipeOut
    return new XElement(&quot;WipedOut&quot;, userId);
}&lt;/code&gt;</description>
		<content:encoded><![CDATA[<p>Hi Dan.  This post was recently of great use to me.  I used it for something slightly different.  Being a strong advocate of the &#8220;HTTP GET should never be destructive&#8221; philosophy, I like the fact that WCF will return &#8220;method not allowed&#8221; if you try and access a WebInvoke with GET.  However, some of my colleagues (especially those implementing REST services in perl) are in the habit if testing their services by typing URLs in their web browser and claim that requiring POST is too inconvenient.  To get the best of both worlds, I say you can have the GET return a form that does the POST.  Here&#8217;s how to do it with WCF using your technique.</p>
<p>The service contract:<br />
<code><br />
[OperationContract]<br />
[WebGet(UriTemplate = "WipeOut/user={userId}")]<br />
System.IO.Stream StartWipeout(string userId);</p>
<p>// both the Get and the Invoke share the same UriTemplate<br />
[OperationContract]<br />
[WebInvoke(UriTemplate = "WipeOut/user={userId}")]<br />
XElement DoWipeout(string addressBookId);<br />
</code></p>
<p>The implementation:<br />
<code><br />
public Stream StartWipeout(string userId)<br />
{<br />
    MemoryStream ms = new MemoryStream();<br />
    StreamWriter sw = new StreamWriter(ms, Encoding.UTF8);<br />
    sw.Write("This will clear all data for " + HttpUtility.HtmlEncode(userId) + "");<br />
    sw.Write("");<br />
    if (null != WebOperationContext.Current)<br />
        WebOperationContext.Current.OutgoingResponse.ContentType = "text/html";<br />
    sw.Flush();</p>
<p>    ms.Position = 0;<br />
    return ms;<br />
}<br />
public XElement DoWipeout(string userId)<br />
{<br />
    // actually do the WipeOut<br />
    return new XElement("WipedOut", userId);<br />
}</code></p>
]]></content:encoded>
	</item>
	<item>
		<title>By: Iwan</title>
		<link>http://www.danrigsby.com/blog/index.php/2008/05/29/rest-services-and-metadata-endpoints-in-wcf/comment-page-1/#comment-741</link>
		<dc:creator>Iwan</dc:creator>
		<pubDate>Tue, 29 Jul 2008 08:51:48 +0000</pubDate>
		<guid isPermaLink="false">http://www.danrigsby.com/blog/?p=231#comment-741</guid>
		<description>re-post XML data for comment no.10

&quot;&lt;Contact&gt; &lt;ContactId&gt;10&lt;/ContactId&gt; &lt;Name&gt;ABC S&lt;/Name&gt; &lt;PhoneNumber&gt;555-0001&lt;/PhoneNumber&gt;&lt;/Contact&gt;&quot;</description>
		<content:encoded><![CDATA[<p>re-post XML data for comment no.10</p>
<p>&#8220;&lt;Contact&gt; &lt;ContactId&gt;10&lt;/ContactId&gt; &lt;Name&gt;ABC S&lt;/Name&gt; &lt;PhoneNumber&gt;555-0001&lt;/PhoneNumber&gt;&lt;/Contact&gt;&#8221;</p>
]]></content:encoded>
	</item>
	<item>
		<title>By: Iwan</title>
		<link>http://www.danrigsby.com/blog/index.php/2008/05/29/rest-services-and-metadata-endpoints-in-wcf/comment-page-1/#comment-740</link>
		<dc:creator>Iwan</dc:creator>
		<pubDate>Tue, 29 Jul 2008 06:43:56 +0000</pubDate>
		<guid isPermaLink="false">http://www.danrigsby.com/blog/?p=231#comment-740</guid>
		<description>Hi Dan,
i tried to download your application and test it. It works fine for GET. But when I tried to test the POST/contact, by calling this url = &quot;http://localhost:8080/ContactService/contact&quot; and POST xml data below

10ABC555-0001

... this POST request never hit the &quot;expected&quot; endpoint. Could you give me enlightenment? Is there any special thing with XML format to adhere?</description>
		<content:encoded><![CDATA[<p>Hi Dan,<br />
i tried to download your application and test it. It works fine for GET. But when I tried to test the POST/contact, by calling this url = &#8220;http://localhost:8080/ContactService/contact&#8221; and POST xml data below</p>
<p>10ABC555-0001</p>
<p>&#8230; this POST request never hit the &#8220;expected&#8221; endpoint. Could you give me enlightenment? Is there any special thing with XML format to adhere?</p>
]]></content:encoded>
	</item>
	<item>
		<title>By: Dan Rigsby &#187; REST and Max URL Size</title>
		<link>http://www.danrigsby.com/blog/index.php/2008/05/29/rest-services-and-metadata-endpoints-in-wcf/comment-page-1/#comment-680</link>
		<dc:creator>Dan Rigsby &#187; REST and Max URL Size</dc:creator>
		<pubDate>Tue, 17 Jun 2008 18:47:41 +0000</pubDate>
		<guid isPermaLink="false">http://www.danrigsby.com/blog/?p=231#comment-680</guid>
		<description>[...] This just makes things confusing and less discoverable.&#160; Especially since REST has no way to publish metadata about the operations.&#160;&#160; You could follow standards such as [...]</description>
		<content:encoded><![CDATA[<p>[...] This just makes things confusing and less discoverable.&#160; Especially since REST has no way to publish metadata about the operations.&#160;&#160; You could follow standards such as [...]</p>
]]></content:encoded>
	</item>
	<item>
		<title>By: Weekly Links: Silverlight 2, WPF, ASP.NET MVC, jQuery&#8230; &#124; Code-Inside Blog International</title>
		<link>http://www.danrigsby.com/blog/index.php/2008/05/29/rest-services-and-metadata-endpoints-in-wcf/comment-page-1/#comment-667</link>
		<dc:creator>Weekly Links: Silverlight 2, WPF, ASP.NET MVC, jQuery&#8230; &#124; Code-Inside Blog International</dc:creator>
		<pubDate>Mon, 09 Jun 2008 19:14:42 +0000</pubDate>
		<guid isPermaLink="false">http://www.danrigsby.com/blog/?p=231#comment-667</guid>
		<description>[...] REST Services and Metadata Endpoints in WCF [...]</description>
		<content:encoded><![CDATA[<p>[...] REST Services and Metadata Endpoints in WCF [...]</p>
]]></content:encoded>
	</item>
	<item>
		<title>By: W&#246;chentliche Rundablage: Silverlight 2, WPF, ASP.NET MVC, jQuery&#8230; &#124; Code-Inside Blog</title>
		<link>http://www.danrigsby.com/blog/index.php/2008/05/29/rest-services-and-metadata-endpoints-in-wcf/comment-page-1/#comment-666</link>
		<dc:creator>W&#246;chentliche Rundablage: Silverlight 2, WPF, ASP.NET MVC, jQuery&#8230; &#124; Code-Inside Blog</dc:creator>
		<pubDate>Mon, 09 Jun 2008 19:14:06 +0000</pubDate>
		<guid isPermaLink="false">http://www.danrigsby.com/blog/?p=231#comment-666</guid>
		<description>[...] REST Services and Metadata Endpoints in WCF [...]</description>
		<content:encoded><![CDATA[<p>[...] REST Services and Metadata Endpoints in WCF [...]</p>
]]></content:encoded>
	</item>
	<item>
		<title>By: chris</title>
		<link>http://www.danrigsby.com/blog/index.php/2008/05/29/rest-services-and-metadata-endpoints-in-wcf/comment-page-1/#comment-658</link>
		<dc:creator>chris</dc:creator>
		<pubDate>Thu, 05 Jun 2008 23:20:29 +0000</pubDate>
		<guid isPermaLink="false">http://www.danrigsby.com/blog/?p=231#comment-658</guid>
		<description>OK - thanks for the reply. could you use it to return an XSD which describes the format of the xml that the various webmethods (for want of a better word) return?</description>
		<content:encoded><![CDATA[<p>OK &#8211; thanks for the reply. could you use it to return an XSD which describes the format of the xml that the various webmethods (for want of a better word) return?</p>
]]></content:encoded>
	</item>
	<item>
		<title>By: Dan Rigsby</title>
		<link>http://www.danrigsby.com/blog/index.php/2008/05/29/rest-services-and-metadata-endpoints-in-wcf/comment-page-1/#comment-657</link>
		<dc:creator>Dan Rigsby</dc:creator>
		<pubDate>Thu, 05 Jun 2008 11:10:06 +0000</pubDate>
		<guid isPermaLink="false">http://www.danrigsby.com/blog/?p=231#comment-657</guid>
		<description>&lt;p&gt;Hi Chris,&lt;br /&gt;&lt;br /&gt;It is not possible to generate a proxy for REST services.  You can generate wsdl for the service though since the contract still uses ServiceContract and OperationContract attributes.  However you cannot use this metadata to generate a proxy to a REST endpoint.  You can still use it to talk to any other type of endpoint though.  You could have your service exposed via REST and wsHttp.  You could also use this metadata as a means to understand the POX returned from a REST service.  REST just returns the pure XML representation of the objects (unless you specify a different format such as JSON).&lt;/p&gt;</description>
		<content:encoded><![CDATA[<p>Hi Chris,</p>
<p>It is not possible to generate a proxy for REST services.  You can generate wsdl for the service though since the contract still uses ServiceContract and OperationContract attributes.  However you cannot use this metadata to generate a proxy to a REST endpoint.  You can still use it to talk to any other type of endpoint though.  You could have your service exposed via REST and wsHttp.  You could also use this metadata as a means to understand the POX returned from a REST service.  REST just returns the pure XML representation of the objects (unless you specify a different format such as JSON).</p>
]]></content:encoded>
	</item>
</channel>
</rss>

