<?xml version="1.0" encoding="UTF-8" ?>
<?xml-stylesheet type="text/xsl" href="http://bloggingabout.net/utility/FeedStylesheets/rss.xsl" media="screen"?><rss version="2.0" xmlns:dc="http://purl.org/dc/elements/1.1/" xmlns:slash="http://purl.org/rss/1.0/modules/slash/" xmlns:wfw="http://wellformedweb.org/CommentAPI/"><channel><title>Search results matching tags 'PDC08', 'M Language', and 'AppFabric'</title><link>http://bloggingabout.net/search/SearchResults.aspx?a=1&amp;o=DateDescending&amp;tag=PDC08,M+Language,AppFabric&amp;orTags=0</link><description>Search results matching tags 'PDC08', 'M Language', and 'AppFabric'</description><dc:language>en-US</dc:language><generator>CommunityServer 2008.5 SP2 (Build: 40407.4157)</generator><item><title>“M” and MService</title><link>http://bloggingabout.net/blogs/dennis/archive/2008/10/30/m-and-mservice.aspx</link><pubDate>Thu, 30 Oct 2008 19:02:25 GMT</pubDate><guid isPermaLink="false">813b6dfd-644e-4573-a816-eebab56ba0d0:476379</guid><dc:creator>Dennis van der Stelt</dc:creator><description>&lt;p&gt;I’ve been talking to people and perhaps here on the blog that during the Doug Purdy talk they showed a demo of MService where, with a few lines of code, a REST enabled WCF services with WF activities was created with only so few lines of actual code.&lt;/p&gt;  &lt;div style="border-right:#cccccc 1pt solid;padding-right:1pt;border-top:#cccccc 1pt solid;padding-left:1pt;font-size:10pt;background:#f5f5f5;padding-bottom:1pt;overflow:auto;border-left:#cccccc 1pt solid;width:100%;color:black;padding-top:1pt;border-bottom:#cccccc 1pt solid;font-family:lucida console;"&gt;   &lt;p style="margin:0px;"&gt;service Service&lt;/p&gt;    &lt;p style="margin:0px;"&gt;{&lt;/p&gt;    &lt;p style="margin:0px;"&gt;&amp;#160; operation PhotoUpload(stream : Stream) : Text&lt;/p&gt;    &lt;p style="margin:0px;"&gt;&amp;#160; {&lt;/p&gt;    &lt;p style="margin:0px;"&gt;&amp;#160;&amp;#160;&amp;#160; .PostUriTemplate = &lt;span style="color:#a31515;"&gt;&amp;quot;upload&amp;quot;&lt;/span&gt;;&lt;/p&gt;    &lt;p style="margin:0px;"&gt;&amp;#160;&lt;/p&gt;    &lt;p style="margin:0px;"&gt;&amp;#160;&amp;#160;&amp;#160; index : Text = invoke DateTime.Now.Ticks.ToString();&lt;/p&gt;    &lt;p style="margin:0px;"&gt;&amp;#160;&amp;#160;&amp;#160; filename : Text = &lt;span style="color:#a31515;"&gt;&amp;quot;d:\\demo\\photo\\&amp;quot;&lt;/span&gt; + index + &lt;span style="color:#a31515;"&gt;&amp;quot;.jpg&amp;quot;&lt;/span&gt;;&lt;/p&gt;    &lt;p style="margin:0px;"&gt;&amp;#160;&amp;#160;&amp;#160; invoke MService.ServiceHelper.StoreInFile(stream, filename);&lt;/p&gt;    &lt;p style="margin:0px;"&gt;&amp;#160;&lt;/p&gt;    &lt;p style="margin:0px;"&gt;&amp;#160;&amp;#160;&amp;#160; &lt;span style="color:blue;"&gt;return&lt;/span&gt; index;&lt;/p&gt;    &lt;p style="margin:0px;"&gt;&amp;#160; }&lt;/p&gt;    &lt;p style="margin:0px;"&gt;&amp;#160;&lt;/p&gt;    &lt;p style="margin:0px;"&gt;&amp;#160; operation PhotoGet(index : Text) : Stream&lt;/p&gt;    &lt;p style="margin:0px;"&gt;&amp;#160; {&lt;/p&gt;    &lt;p style="margin:0px;"&gt;&amp;#160;&amp;#160;&amp;#160; .UriTemplate = &lt;span style="color:#a31515;"&gt;&amp;quot;getphoto/{index}&amp;quot;&lt;/span&gt;;&lt;/p&gt;    &lt;p style="margin:0px;"&gt;&amp;#160;&amp;#160;&amp;#160; .ContentType = &lt;span style="color:#a31515;"&gt;&amp;quot;image/jpeg&amp;quot;&lt;/span&gt;;&lt;/p&gt;    &lt;p style="margin:0px;"&gt;&amp;#160;&lt;/p&gt;    &lt;p style="margin:0px;"&gt;&amp;#160;&amp;#160;&amp;#160; filename : Text = &lt;span style="color:#a31515;"&gt;&amp;quot;d:\\demo\\photo\\&amp;quot;&lt;/span&gt; + index + &lt;span style="color:#a31515;"&gt;&amp;quot;.jpg&amp;quot;&lt;/span&gt;;&lt;/p&gt;    &lt;p style="margin:0px;"&gt;&amp;#160;&amp;#160;&amp;#160; &lt;span style="color:blue;"&gt;return&lt;/span&gt; invoke File.OpenRead(filename);&lt;/p&gt;    &lt;p style="margin:0px;"&gt;&amp;#160; }&lt;/p&gt;    &lt;p style="margin:0px;"&gt;&amp;#160;&lt;/p&gt;    &lt;p style="margin:0px;"&gt;&amp;#160; endpoint HttpEndpoint&lt;/p&gt;    &lt;p style="margin:0px;"&gt;&amp;#160; {&lt;/p&gt;    &lt;p style="margin:0px;"&gt;&amp;#160;&amp;#160;&amp;#160; Binding = WebHttpBinding;&lt;/p&gt;    &lt;p style="margin:0px;"&gt;&amp;#160;&amp;#160;&amp;#160; Address = &lt;span style="color:#a31515;"&gt;&amp;quot;http://localhost:8080/service/&amp;quot;&lt;/span&gt;;&lt;/p&gt;    &lt;p style="margin:0px;"&gt;&amp;#160; }&lt;/p&gt;    &lt;p style="margin:0px;"&gt;}&lt;/p&gt; &lt;/div&gt;  &lt;p&gt;Add breakpoints, post a photo or get one and the breakpoints are hit under debugging. You can see activities and endpoints in the locals window.&lt;/p&gt;  &lt;p&gt;At the bottom you can see the endpoint defined. The first operation is PhotoUpload and it invokes code to store a file. Runtime this results in a WF activity storing the file on disc. The second operation is the get and it invokes a file read activity.&lt;/p&gt;  &lt;p&gt;In the PhotoUpload operation you also see the invoke of DateTime.Now.Ticks.ToString(), which will result in a code-activity in WF, running the specified code.&lt;/p&gt;  &lt;p&gt;This is just it, a REST enabled service for uploading, storing and retrieving images.&lt;/p&gt;  &lt;p&gt;Remember that this is MService, including a WF/WCF runtime that understands the language ‘M’, hosted inside Dublin.&lt;/p&gt;</description></item></channel></rss>