<?xml version="1.0" encoding="UTF-8" ?>
<?xml-stylesheet type="text/xsl" href="http://forums.asp.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>WCF REST Starter Kit</title><link>http://forums.asp.net/1180.aspx</link><description>Discuss the WCF REST Starter Kit and other WCF REST topics.</description><dc:language>en</dc:language><generator>CommunityServer 2007 SP1 (Build: 20510.895)</generator><item><title>client with namespace prefixes</title><link>http://forums.asp.net/thread/3526272.aspx</link><pubDate>Sun, 22 Nov 2009 12:46:23 GMT</pubDate><guid isPermaLink="false">4c671506-2930-414c-a40b-8bf57ded5924:3526272</guid><dc:creator>PauliusRaila</dc:creator><author>PauliusRaila</author><slash:comments>0</slash:comments><comments>http://forums.asp.net/thread/3526272.aspx</comments><wfw:commentRss>http://forums.asp.net/commentrss.aspx?SectionID=1180&amp;PostID=3526272</wfw:commentRss><description>&lt;p&gt;Hi,&lt;/p&gt;&lt;p&gt;I am writting a client for &lt;b&gt;JBoss &lt;/b&gt;server. I use the &lt;b&gt;HttpClient &lt;/b&gt;from &amp;quot;&lt;i&gt;WCF REST&lt;/i&gt; Starter Kit&amp;quot;.&lt;/p&gt;&lt;p&gt;I need to send a message in xml format like this:&lt;/p&gt;&lt;p&gt;&amp;lt;prefix:prepaidAccount xmlns:prefix=&amp;quot;http://company.name.com&amp;quot;&amp;gt;&lt;br /&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp; &amp;lt;firstName&amp;gt;Paulius&amp;lt;/firstName&amp;gt;&lt;br /&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp; &amp;lt;lastName&amp;gt;Raila&amp;lt;/lastName&amp;gt;&lt;/p&gt;&lt;p&gt;...&amp;nbsp; &lt;br /&gt;&amp;lt;/prefix:prepaidAccount&amp;gt;&lt;/p&gt;&lt;p&gt;I have a class generated with &lt;b&gt;xsd.exe&lt;/b&gt; tool from the xsd scheme. &lt;/p&gt;&lt;p&gt;Currently i use the following technique to serialize objexts with Xmlserializes in order to add the &lt;b&gt;namespace &lt;/b&gt;prefixes:&lt;br /&gt;&lt;/p&gt;&lt;p&gt;XmlSerializerNamespaces namespaces = new XmlSerializerNamespaces();&lt;br /&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; namespaces.Add(&amp;quot;prefix&amp;quot;, &amp;quot;http://company.name.com&amp;quot;);&lt;/p&gt;&lt;p&gt;XmlSerializer ser = new XmlSerializer(typeof(PrepaidAccount));&lt;br /&gt;ser.Serialize(writter, prep, namespaces);&lt;/p&gt;&lt;p&gt;&lt;b&gt;Unfortunetely &lt;/b&gt;i failed to use the benefits of &lt;b&gt;HttpContentExtensions &lt;/b&gt;library.(can&amp;#39;t add namespace prefixes).&lt;/p&gt;&lt;p&gt;Have somebody faced similar problems ?&lt;br /&gt;&lt;/p&gt;&lt;p&gt;&lt;br /&gt;&lt;/p&gt;</description></item><item><title>ICollectionService&lt;T&gt; == adaptable ? thenUseIt : butItsNot;</title><link>http://forums.asp.net/thread/3525147.aspx</link><pubDate>Sat, 21 Nov 2009 05:31:06 GMT</pubDate><guid isPermaLink="false">4c671506-2930-414c-a40b-8bf57ded5924:3525147</guid><dc:creator>DevilDog74</dc:creator><author>DevilDog74</author><slash:comments>0</slash:comments><comments>http://forums.asp.net/thread/3525147.aspx</comments><wfw:commentRss>http://forums.asp.net/commentrss.aspx?SectionID=1180&amp;PostID=3525147</wfw:commentRss><description>&lt;p&gt;Here is the question -&amp;gt; Is it possible to add my own behavior to CollectionBase&amp;lt;T&amp;gt; or Adapt the interface ICollectionService&amp;lt;T&amp;gt;?&lt;/p&gt;
&lt;p&gt;The rest of the post is a mini-rant followed by a user story...&lt;/p&gt;
&lt;p&gt;I was playing with the&amp;nbsp;Rest Collection WCF service.&amp;nbsp; I&amp;nbsp;got everything up and running no problem.&amp;nbsp; Nice work!&amp;nbsp; I notice that&amp;nbsp;my&amp;nbsp;cs file was simply&amp;nbsp;overriding the methods from CollectionService&amp;lt;T&amp;gt; and that my&amp;nbsp;shiny new class implemented an interface ICollectionService&amp;lt;T&amp;gt;.&lt;/p&gt;
&lt;p&gt;In looking at ICollectionService&amp;lt;T&amp;gt; I saw all of the&amp;nbsp;service operations&amp;nbsp;that one might want when working with a restful collection.&lt;/p&gt;
&lt;p&gt;Except 1 -&amp;gt; GetItemsWithFilter(string id).&amp;nbsp; O-rly?&amp;nbsp; Srsly?&amp;nbsp; Can you imagine this restful collection service =&amp;gt; &lt;a href="http://www.amazon.com/books"&gt;http://www.amazon.com/books&lt;/a&gt;... presumably that would be a huge collection.&lt;/p&gt;
&lt;p&gt;Why is there no way to filter a collection?&amp;nbsp; Maybe you want to be cool like the RIA guys and add paging but you dont want to use RIA services?&amp;nbsp; I dunno.&amp;nbsp; Maybe my service consumers want to pull one million products from my product catalog (can you imagine that feed?&amp;nbsp; The collection service is a cool idea, but the &amp;quot;ALL or One&amp;quot; approach seems a bit limiting?&lt;/p&gt;
&lt;p&gt;That was my rant... the code below shows what I tried to do, which was to add my own behavior to your cool new toys.&amp;nbsp; &lt;/p&gt;
&lt;p&gt;&amp;quot;As a software engineer I want to write a CollectionService that allows me to filter the collection server side.&amp;nbsp; I want to use the uri &lt;a href="http://mydomain:25000/tagservice.svc/category/123?format=json"&gt;http://mydomain:25000/tagservice.svc/category/123?format=json&lt;/a&gt; to get a list of tags, filtered by category 123, in json format.&amp;nbsp; I would like to be able to subclass CollectionServiceBase&amp;lt;T&amp;gt; and Adapt ICollectionService&amp;lt;T&amp;gt;&amp;quot;&lt;/p&gt;
&lt;p&gt;I started by trying to adapt ICollectionService using the code below...&lt;/p&gt;&lt;pre class="c-sharp" name="code"&gt;    public interface ITagsCollectionService : ICollectionService&amp;lt;TagData&amp;gt;
    {
        [WebHelp(Comment = &amp;quot;Returns the items in the collection, filtered by SystemObjectId in JSON format&amp;quot;]
        [WebGet(UriTemplate = &amp;quot;category/{id}?format=json&amp;quot;, ResponseFormat = WebMessageFormat.Json)]
        [OperationContract]
        ItemInfoList&amp;lt;TagData&amp;gt; GetItemsInJsonById(string id);        
    }&lt;/pre&gt;
&lt;p&gt;&lt;br /&gt;&amp;nbsp;&lt;/p&gt;
&lt;p&gt;I implemented the method above in my service, and the code was never executed at runtime...&lt;/p&gt;
&lt;p&gt;So then I tried this code....&lt;/p&gt;&lt;pre class="c-sharp" name="code"&gt;    public interface ITagsCollectionService : ICollectionService&amp;lt;TagData&amp;gt;
    {
        [WebHelp(Comment = &amp;quot;Returns the items in the collection, filtered by SystemObjectId in JSON format&amp;quot;]
        [WebGet(UriTemplate = &amp;quot;test({id})?format=json&amp;quot;, ResponseFormat = WebMessageFormat.Json)]
        [OperationContract]
        ItemInfoList&amp;lt;TagData&amp;gt; GetTagsBySystemObjectIdInJson(string id);        
    }&lt;/pre&gt;
&lt;p&gt;&lt;br /&gt;That code got intercepted by the override for OnGetItem, another fail....&lt;/p&gt;
&lt;p&gt;Then I tried the brute force mechanism.&amp;nbsp; I moved the&amp;nbsp;[OperationContract] and related attributes into the service implementation by decorating&amp;nbsp;my method, only to fail again (because [ServiceContract] can only be on a class or the interface, not both)...&lt;/p&gt;&lt;pre class="c-sharp" name="code"&gt;        [WebHelp(Comment = &amp;quot;Returns the items in the collection, filtered by SystemObjectId in JSON format, along with URI links to each item.&amp;quot;)]
        [WebGet(UriTemplate = &amp;quot;SystemObjectId/{SysObjectId}?format=json&amp;quot;, ResponseFormat = WebMessageFormat.Json)]
        [OperationContract]
        public ItemInfoList&amp;lt;TagData&amp;gt; GetTagsBySystemObjectIdInJson(string id) {
            return null;
        }&lt;/pre&gt;
&lt;p&gt;&lt;br /&gt;Aside from filling in the blanks for the overridden methods of CollectionServiceBase, it doesnt look like I can extend CollectionServiceBase&amp;lt;T&amp;gt; by adding my own behavior, nor does it appear that I can adapt your interface ICollectionBase&amp;lt;T&amp;gt;.&lt;/p&gt;
&lt;p&gt;I suppose I can just create my own ITagService and copy your methods from ICollectionService&amp;lt;T&amp;gt;.&lt;/p&gt;</description></item><item><title>How to make the UriTemplate to accept the Character colon ":"</title><link>http://forums.asp.net/thread/3517205.aspx</link><pubDate>Tue, 17 Nov 2009 09:39:58 GMT</pubDate><guid isPermaLink="false">4c671506-2930-414c-a40b-8bf57ded5924:3517205</guid><dc:creator>srihari.kilari</dc:creator><author>srihari.kilari</author><slash:comments>1</slash:comments><comments>http://forums.asp.net/thread/3517205.aspx</comments><wfw:commentRss>http://forums.asp.net/commentrss.aspx?SectionID=1180&amp;PostID=3517205</wfw:commentRss><description>&lt;p&gt;Hi all,&lt;/p&gt;
&lt;p&gt;I am&amp;nbsp;implementing the RESTFull services using WCF. My uriTemplate is having wildcharacter (*)&amp;nbsp; to pick the all filter information from the url. My Contract method is defined as &lt;/p&gt;
&lt;p&gt;&lt;font size="2"&gt;
&lt;p&gt;[&lt;/font&gt;&lt;font color="#2b91af" size="2"&gt;&lt;font color="#2b91af" size="2"&gt;OperationContract&lt;/font&gt;&lt;/font&gt;&lt;font size="2"&gt;]&lt;/font&gt;&lt;/p&gt;
&lt;p&gt;&lt;font color="#2b91af" size="2"&gt;&lt;font color="#2b91af" size="2"&gt;[WebGet&lt;/font&gt;&lt;/font&gt;&lt;font size="2"&gt;(BodyStyle = &lt;/font&gt;&lt;font color="#2b91af" size="2"&gt;&lt;font color="#2b91af" size="2"&gt;WebMessageBodyStyle&lt;/font&gt;&lt;/font&gt;&lt;font size="2"&gt;.Bare, ResponseFormat = &lt;/font&gt;&lt;font color="#2b91af" size="2"&gt;&lt;font color="#2b91af" size="2"&gt;WebMessageFormat&lt;/font&gt;&lt;/font&gt;&lt;font size="2"&gt;.Xml, UriTemplate = &lt;/font&gt;&lt;font color="#a31515" size="2"&gt;&lt;font color="#a31515" size="2"&gt;&amp;quot;details/pox/*&amp;quot;&lt;/font&gt;&lt;/font&gt;&lt;font size="2"&gt;)]&lt;/font&gt;&lt;/p&gt;
&lt;p&gt;&lt;font size="2"&gt;&lt;font color="#2b91af"&gt;PersonInfo&lt;/font&gt;&amp;nbsp;GetPersonDetailsAsXml();&lt;/font&gt;&lt;/p&gt;
&lt;p&gt;&lt;font size="2"&gt;[&lt;font color="#2b91af"&gt;&lt;font color="#2b91af"&gt;OperationContract&lt;/font&gt;&lt;/font&gt;]&lt;/font&gt;&lt;/p&gt;
&lt;p&gt;&lt;font size="2"&gt;&lt;font color="#2b91af"&gt;&lt;font color="#2b91af"&gt;WebGet&lt;/font&gt;&lt;/font&gt;(BodyStyle = &lt;font color="#2b91af"&gt;&lt;font color="#2b91af"&gt;WebMessageBodyStyle&lt;/font&gt;&lt;/font&gt;.Bare, ResponseFormat = &lt;font color="#2b91af"&gt;&lt;font color="#2b91af"&gt;WebMessageFormat&lt;/font&gt;&lt;/font&gt;.Json, UriTemplate = &lt;font color="#a31515"&gt;&lt;font color="#a31515"&gt;&amp;quot;/details/json/*&amp;quot;&lt;/font&gt;&lt;/font&gt;)]&lt;/font&gt;&lt;/p&gt;
&lt;p&gt;&lt;font size="2"&gt;&lt;font color="#2b91af"&gt;&lt;font color="#2b91af"&gt;PersonInfo &lt;/font&gt;&lt;/font&gt;GetPersonDetailsAsJson();&lt;/font&gt;&lt;/p&gt;
&lt;p&gt;&lt;font size="2"&gt;Problem: If the url contains the character &amp;quot;:&amp;quot; (colon), the corresponding method is not getting invoked. In rest of the cases, it is working fine. Please let me know if any body knows.&lt;/font&gt;&lt;/p&gt;
&lt;p&gt;&lt;font size="2"&gt;Thanks,&lt;/font&gt;&lt;/p&gt;
&lt;p&gt;&lt;font size="2"&gt;Kilari&lt;/font&gt;&lt;/p&gt;&lt;/p&gt;
&lt;p&gt;&amp;nbsp;&lt;/p&gt;</description></item><item><title>How Can I Get The Starter Kit to Return JSON Responses as JSONP</title><link>http://forums.asp.net/thread/3458811.aspx</link><pubDate>Wed, 14 Oct 2009 22:13:03 GMT</pubDate><guid isPermaLink="false">4c671506-2930-414c-a40b-8bf57ded5924:3458811</guid><dc:creator>rhizohm</dc:creator><author>rhizohm</author><slash:comments>2</slash:comments><comments>http://forums.asp.net/thread/3458811.aspx</comments><wfw:commentRss>http://forums.asp.net/commentrss.aspx?SectionID=1180&amp;PostID=3458811</wfw:commentRss><description>&lt;p&gt;Didn&amp;#39;t see this in the docs anywhere and wondering if it is supported to&amp;nbsp;return JSON Responses as JSONP, as in&lt;/p&gt;
&lt;p&gt;[WebGet(UriTemplate = &amp;quot;?callback={callback}]&lt;/p&gt;
&lt;p&gt;string GetData(string callback)&lt;/p&gt;
&lt;p&gt;and then populate the return value with whatever was passed in the callback variable, aka if the variable that was passed was &amp;quot;cb&amp;quot; it would return:&lt;/p&gt;
&lt;p&gt;&amp;nbsp;&lt;/p&gt;
&lt;p&gt;cb({&amp;quot;key&amp;quot;:&amp;quot;value&amp;quot;}) &lt;/p&gt;
&lt;p&gt;instead of just &lt;/p&gt;
&lt;p&gt;{&amp;quot;key&amp;quot;:&amp;quot;value&amp;quot;}&lt;/p&gt;
&lt;p&gt;&amp;nbsp;&lt;/p&gt;</description></item><item><title>UriTemplate and string[]</title><link>http://forums.asp.net/thread/3041391.aspx</link><pubDate>Thu, 26 Mar 2009 23:31:45 GMT</pubDate><guid isPermaLink="false">4c671506-2930-414c-a40b-8bf57ded5924:3041391</guid><dc:creator>ecmdev</dc:creator><author>ecmdev</author><slash:comments>2</slash:comments><comments>http://forums.asp.net/thread/3041391.aspx</comments><wfw:commentRss>http://forums.asp.net/commentrss.aspx?SectionID=1180&amp;PostID=3041391</wfw:commentRss><description>&lt;p&gt;Hi everyone,&lt;/p&gt;&lt;p&gt;Firstly thanks for the WCF REST Starter kit, it could well be a great help to us in migrating an existing REST&amp;#39;ish API from a completely different platform into WCF.&lt;/p&gt;&lt;p&gt;One question or feature request I&amp;#39;d like to put up for discussion is the use of string arrays as parameters for UriTemplate e.g. &lt;br /&gt;&lt;/p&gt;&lt;p&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; [WebGet(UriTemplate = &amp;quot;{s}&amp;quot;)]&lt;br /&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; [OperationContract]&lt;br /&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; public Stream GetData(string[] s)&lt;/p&gt;&lt;p&gt;&amp;nbsp;I understand the reasoning behind only allowing strings in UriTemplate but is there any reason why this couldn&amp;#39;t be extended to string arrays that could consume a number of different parameters?&lt;/p&gt;&lt;p&gt;We have an indeterminate number of parameters in our existing API and the only alternative I can find at the moment with the REST Starter Kit would be to have a predefined number each with the default of &amp;quot;index_html&amp;quot; the old final default argument.&amp;nbsp; Which not only is ugly but limiting.&lt;/p&gt;&lt;p&gt;You could put only kind of constraints on that your like, perhaps only one string array per UriTemplate, must be the last, I personally don&amp;#39;t mind, any kind of limited support would be very welcome.&amp;nbsp; But much like a regular expression can consume items until the next matching element I can&amp;#39;t see why in theory UriTemplate couldn&amp;#39;t support more complex templates, perhaps structures like&lt;br /&gt;&lt;/p&gt;&lt;p&gt;&amp;nbsp;&lt;/p&gt;&lt;p&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; [WebGet(UriTemplate = &amp;quot;item/{i}/params/{s}/xml&amp;quot;)]&lt;br /&gt;
&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; [OperationContract]&lt;br /&gt;
&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; public Stream GetData(string i, string[] s)&lt;/p&gt;&lt;p&gt;Would this be too big a change? I can&amp;#39;t think of any downsides, and if it helps us migrate there is a reasonable chance it would help others too.&lt;/p&gt;&lt;p&gt; Thanks!&lt;/p&gt;&lt;p&gt;Mark &lt;br /&gt;&lt;/p&gt;</description></item><item><title>Automated help for services created with WebServiceHost2Factory</title><link>http://forums.asp.net/thread/3513157.aspx</link><pubDate>Sun, 15 Nov 2009 01:00:16 GMT</pubDate><guid isPermaLink="false">4c671506-2930-414c-a40b-8bf57ded5924:3513157</guid><dc:creator>ctaswell</dc:creator><author>ctaswell</author><slash:comments>0</slash:comments><comments>http://forums.asp.net/thread/3513157.aspx</comments><wfw:commentRss>http://forums.asp.net/commentrss.aspx?SectionID=1180&amp;PostID=3513157</wfw:commentRss><description>&lt;p&gt;&amp;nbsp;Regarding services running under WebServiceHost2 or otherwise created with WebServiceHost2Factory, is the automated help that&amp;#39;s supposed to be available at */help intended only for services with the DataContractSerializer?&lt;/p&gt;
&lt;p&gt;Can an alternative service&amp;nbsp;created with WebServiceHost2Factory also&amp;nbsp;be configured to&amp;nbsp;work&amp;nbsp;with the XmlSerializer that implements&amp;nbsp;&lt;/p&gt;
&lt;p&gt;&lt;font size="2" face="Consolas"&gt;&lt;font size="2" face="Consolas"&gt;
&lt;p&gt;System.Xml.Serialization.IXmlSerializable?&lt;/font&gt;&lt;/font&gt;&lt;/p&gt;&lt;/p&gt;</description></item><item><title>Changing MessageEncoder in Interceptor</title><link>http://forums.asp.net/thread/3491425.aspx</link><pubDate>Tue, 03 Nov 2009 12:34:26 GMT</pubDate><guid isPermaLink="false">4c671506-2930-414c-a40b-8bf57ded5924:3491425</guid><dc:creator>habibs</dc:creator><author>habibs</author><slash:comments>4</slash:comments><comments>http://forums.asp.net/thread/3491425.aspx</comments><wfw:commentRss>http://forums.asp.net/commentrss.aspx?SectionID=1180&amp;PostID=3491425</wfw:commentRss><description>&lt;p&gt;Hi, i have a Java mobile clients to my service. Some phones modify
Content-Type of request by inserting text/plain before
application/json; charset=utf-8. This causes exception on the server
because wcf REST service treates incomming request as raw data and uses
stream encoder. I need to replace this with JsonMessageEncoder , for
this i wrote an interceptor and able to catch requests, but i am getting the following error:&lt;/p&gt;&lt;p&gt;---------------------------------------------------------------------------------------&lt;br /&gt;&lt;/p&gt;&lt;p&gt;&lt;b&gt;Error Status Code:&lt;/b&gt; &amp;#39;InternalServerError&amp;#39;&lt;/p&gt;
&lt;p&gt;&lt;b&gt;Details: &lt;/b&gt;Unable to deserialize XML body with root name &amp;#39;Binary&amp;#39; and 
root namespace &amp;#39;&amp;#39; (for operation &amp;#39;Login&amp;#39; and contract (&amp;#39;Auth&amp;#39;, 
&amp;#39;http://tempuri.org/&amp;#39;)) using DataContractSerializer. Ensure that the type 
corresponding to the XML is added to the known types collection of the 
service.&lt;/p&gt;&lt;p&gt;---------------------------------------------------------------------------------------&lt;br /&gt;&lt;/p&gt;
&lt;p&gt;&amp;nbsp;&lt;b&gt;Here is my interceptor&lt;/b&gt;:&lt;/p&gt;&lt;p&gt;&lt;pre name="code" class="c-sharp"&gt;public class MessageInterceptor : RequestInterceptor
    {
        public MessageInterceptor(): base(false)
        {
        }

        public override void ProcessRequest(ref RequestContext requestContext)
        {
            if (requestContext == null) return;
            Message request = requestContext.RequestMessage;

            if (request == null) return;
            var prop = (HttpRequestMessageProperty)request.Properties[HttpRequestMessageProperty.Name];
            
            string contentType = prop.Headers[HttpRequestHeader.ContentType];
            if (contentType != null)
            {
                if (contentType.Contains(&amp;quot;text/plain&amp;quot;))
                {
                    prop.Headers[HttpRequestHeader.ContentType] = &amp;quot;application/json; charset=utf-8&amp;quot;;
                    request.Properties[HttpRequestMessageProperty.Name] = prop;
                    request.Properties[WebBodyFormatMessageProperty.Name] = new WebBodyFormatMessageProperty(WebContentFormat.Json);
                    //var encoder = (MessageEncoder)request.Properties[&amp;quot;Encoder&amp;quot;];
                    
                    request.Properties.Remove(&amp;quot;Encoder&amp;quot;);

                    var element = new WebMessageEncodingBindingElement();
                    var encFac = element.CreateMessageEncoderFactory();
                    
                    request.Properties.Add(&amp;quot;Encoder&amp;quot;,encFac.Encoder);
                }
            }
        }
    }&lt;/pre&gt;&lt;br /&gt; &lt;br /&gt;&lt;/p&gt;</description></item><item><title>WCF Rest Starter Kit in Visual Basic ???</title><link>http://forums.asp.net/thread/3349918.aspx</link><pubDate>Sun, 16 Aug 2009 03:18:39 GMT</pubDate><guid isPermaLink="false">4c671506-2930-414c-a40b-8bf57ded5924:3349918</guid><dc:creator>ctaswell</dc:creator><author>ctaswell</author><slash:comments>7</slash:comments><comments>http://forums.asp.net/thread/3349918.aspx</comments><wfw:commentRss>http://forums.asp.net/commentrss.aspx?SectionID=1180&amp;PostID=3349918</wfw:commentRss><description>&lt;p&gt;Any plans for supporting Visual Basic in the WCF Rest Starter Kit? Any timeline?&lt;/p&gt;&lt;p&gt;Note a simple translation using available C# to VB converters yields output that&amp;#39;s full of errors and does not run. Perhaps a knowledgeable expert can debug and fix... but it&amp;#39;s not a trivial matter for somebody new to WCF REST.&lt;/p&gt;&lt;p&gt;I have heard about so-called &amp;quot;parity&amp;quot; for C# and VB but apparently there&amp;#39;s still a major bias in favor of C# at Microsoft?&lt;/p&gt;</description></item><item><title>Request a ResponseInterceptor class</title><link>http://forums.asp.net/thread/3499810.aspx</link><pubDate>Sat, 07 Nov 2009 16:46:47 GMT</pubDate><guid isPermaLink="false">4c671506-2930-414c-a40b-8bf57ded5924:3499810</guid><dc:creator>bobbyfu</dc:creator><author>bobbyfu</author><slash:comments>2</slash:comments><comments>http://forums.asp.net/thread/3499810.aspx</comments><wfw:commentRss>http://forums.asp.net/commentrss.aspx?SectionID=1180&amp;PostID=3499810</wfw:commentRss><description>&lt;p&gt;The REST starter kit CTP2&amp;nbsp;has an abstract class - RequestInterceptor - that we can intercept a message from the channel.&amp;nbsp; In the future release, is it possible to provide a ResponseInterceptor class? &lt;/p&gt;
&lt;p&gt;Thanks,&lt;/p&gt;
&lt;p&gt;Bobby&lt;/p&gt;</description></item><item><title>What is the correct format of UriTemplate for my REST service in 3.5 (Restful service)</title><link>http://forums.asp.net/thread/3509000.aspx</link><pubDate>Thu, 12 Nov 2009 15:10:28 GMT</pubDate><guid isPermaLink="false">4c671506-2930-414c-a40b-8bf57ded5924:3509000</guid><dc:creator>srihari.kilari</dc:creator><author>srihari.kilari</author><slash:comments>2</slash:comments><comments>http://forums.asp.net/thread/3509000.aspx</comments><wfw:commentRss>http://forums.asp.net/commentrss.aspx?SectionID=1180&amp;PostID=3509000</wfw:commentRss><description>&lt;p&gt;Hi,&lt;/p&gt;
&lt;p&gt;I want to develop the rest service using wcf 3.5, the client can use this service by passing&amp;nbsp; the variable number of parameters (actually called as filters)&amp;nbsp;through URL. Those parameters order/count is not fixed. For example my URL is&lt;/p&gt;
&lt;p&gt;&lt;a href="http://localhost/WcfIISService/MyService.svc/listings/xml/name/hari/qualification/graduate/habbies/cricket,chesss"&gt;http://localhost/WcfIISService/MyService.svc/listings/xml/name/hari/qualification/graduate/habbies/cricket,chesss&lt;/a&gt; . In this URl, the filter information is &amp;quot;name/hari/qualification/graduate/habbies/cricket,chesss&amp;quot;. &lt;/p&gt;
&lt;p&gt;But i need&amp;nbsp;to created name value pairs for these filters (&amp;nbsp;name - hari, qualification - graduate, habbies - crickect, chess) and pass it to the database to get the results back&amp;nbsp;.&amp;nbsp; &lt;/p&gt;
&lt;p&gt;My service contract method is defined as below.&lt;font size="2"&gt;&amp;nbsp;&lt;/p&gt;
&lt;p&gt;&lt;/font&gt;&lt;font color="#2b91af" size="2"&gt;&lt;font color="#2b91af" size="2"&gt;OperationContract&lt;/font&gt;&lt;/font&gt;&lt;font size="2"&gt;]&lt;/font&gt;&lt;font color="#2b91af" size="2"&gt;&lt;font color="#2b91af" size="2"&gt;WebGet&lt;/font&gt;&lt;/font&gt;&lt;font size="2"&gt;(BodyStyle = &lt;/font&gt;&lt;font color="#2b91af" size="2"&gt;&lt;font color="#2b91af" size="2"&gt;WebMessageBodyStyle&lt;/font&gt;&lt;/font&gt;&lt;font size="2"&gt;.Bare, ResponseFormat = &lt;/font&gt;&lt;font color="#2b91af" size="2"&gt;&lt;font color="#2b91af" size="2"&gt;WebMessageFormat&lt;/font&gt;&lt;/font&gt;&lt;font size="2"&gt;.Json, UriTemplate = &lt;/font&gt;&lt;font color="#a31515" size="2"&gt;&lt;font color="#a31515" size="2"&gt;&amp;quot;listings/xml/*filters&amp;quot;&lt;/font&gt;&lt;/font&gt;&lt;font size="2"&gt;)]&lt;/font&gt;&lt;font color="#2b91af" size="2"&gt;&lt;font color="#2b91af" size="2"&gt;List&amp;lt;PersonDetails&amp;gt;&lt;/font&gt;&lt;/font&gt;&lt;font size="2"&gt; GetPersonDetails(&lt;/font&gt;&lt;font color="#2b91af" size="2"&gt;&lt;font color="#2b91af" size="2"&gt;String&lt;/font&gt;&lt;/font&gt;&lt;font size="2"&gt; filters);&lt;/font&gt;&lt;/p&gt;
&lt;p&gt;&lt;font size="2"&gt;It is giving an error saying that &amp;quot;&lt;/font&gt;&lt;font size="2"&gt;Operation GetPersonDetails contract &amp;#39;IPersonDetails&amp;#39; uses GET, but also has body parameter &amp;#39;filters&amp;#39;. GET operations cannot have a body. Either make the parameter &amp;#39;filters&amp;#39; a UriTemplate parameter, or switch from WebGetAttribute to WebInvokeAttribute. &lt;/font&gt;&lt;/p&gt;
&lt;p&gt;&lt;font size="2"&gt;Note: I can&amp;#39;t create overloaded method with number of input parameters in URL, since client may or may not use all parameters or may use few parameters with out any order.&amp;nbsp;&lt;/font&gt;&lt;font size="2"&gt;&lt;br /&gt;&lt;/font&gt;I think the problem is with &amp;quot;UriTemplate&amp;quot;.&amp;nbsp; Please&amp;nbsp; help me if anybody knows.&lt;/p&gt;
&lt;p&gt;Thanks in Advance,&lt;/p&gt;
&lt;p&gt;Kilari&lt;/p&gt;</description></item><item><title>Client code to consume Restful Collection service</title><link>http://forums.asp.net/thread/3476074.aspx</link><pubDate>Sun, 25 Oct 2009 21:30:05 GMT</pubDate><guid isPermaLink="false">4c671506-2930-414c-a40b-8bf57ded5924:3476074</guid><dc:creator>fredcouples</dc:creator><author>fredcouples</author><slash:comments>1</slash:comments><comments>http://forums.asp.net/thread/3476074.aspx</comments><wfw:commentRss>http://forums.asp.net/commentrss.aspx?SectionID=1180&amp;PostID=3476074</wfw:commentRss><description>&lt;p&gt;As the collections returned from a Collection service is an ItemInfoList containing ItemInfo elements and a single item returned is a ex. Bookmark i don&amp;#39;t see the client code being &amp;#39;easy&amp;#39; to implement. Changing the ItemInfo attribute seem to be hidding so I can&amp;#39;t do that - yet.&lt;/p&gt;&lt;p&gt;Does anyone have a simple way of writing client code ?&lt;/p&gt;&lt;p&gt;&lt;br /&gt;&lt;/p&gt;&lt;p&gt;Thanks&lt;/p&gt;&lt;p&gt;Paul S&lt;br /&gt;&lt;/p&gt;</description></item><item><title>WCF REST Starter Kit for .NET Framework 4.0</title><link>http://forums.asp.net/thread/3491999.aspx</link><pubDate>Tue, 03 Nov 2009 17:02:58 GMT</pubDate><guid isPermaLink="false">4c671506-2930-414c-a40b-8bf57ded5924:3491999</guid><dc:creator>joychak1</dc:creator><author>joychak1</author><slash:comments>3</slash:comments><comments>http://forums.asp.net/thread/3491999.aspx</comments><wfw:commentRss>http://forums.asp.net/commentrss.aspx?SectionID=1180&amp;PostID=3491999</wfw:commentRss><description>&lt;p&gt;Is there any WCF REST Starter Kit available for .NET Framework 4.0 and VS 2010 beta 2?&lt;/p&gt;</description></item><item><title>Problem in consuming hosted WCF service</title><link>http://forums.asp.net/thread/3507947.aspx</link><pubDate>Thu, 12 Nov 2009 05:54:57 GMT</pubDate><guid isPermaLink="false">4c671506-2930-414c-a40b-8bf57ded5924:3507947</guid><dc:creator>rajuls</dc:creator><author>rajuls</author><slash:comments>1</slash:comments><comments>http://forums.asp.net/thread/3507947.aspx</comments><wfw:commentRss>http://forums.asp.net/commentrss.aspx?SectionID=1180&amp;PostID=3507947</wfw:commentRss><description>&lt;p&gt;Hi
My problem is 
I have hosted my wcf service on IIS 5.1 on machine &amp;#39;A&amp;#39;, it is working fine and on trying to consume it in my web application on machine &amp;#39;Web&amp;#39;. &lt;b&gt;I am able to consume it.&lt;/b&gt;
But when i hosted it on Machine &amp;#39;B&amp;#39;, it is working fine. I tried it to consume it locally, I am able to do it.
But when I tried to consume it on machine &amp;#39;Web&amp;#39;, i am getting the following error:

The document at the url http://MacB/WCF11/service1.svc was not recognized as a known document type.
The error message from each known type may help you fix the problem:
- Report from &amp;#39;http://MacB/WCF11/service1.svc&amp;#39; is &amp;#39;The document format is not recognized (the content type is &amp;#39;text/html; charset=UTF-8&amp;#39;).&amp;#39;.
- Report from &amp;#39;DISCO Document&amp;#39; is &amp;#39;There was an error downloading &amp;#39;http://MacB/WCF11/Service1.svc?disco&amp;#39;.&amp;#39;.
  - The remote name could not be resolved: &amp;#39;MacB&amp;#39;
- Report from &amp;#39;WSDL Document&amp;#39; is &amp;#39;The document format is not recognized (the content type is &amp;#39;text/html; charset=UTF-8&amp;#39;).&amp;#39;.
- Report from &amp;#39;XML Schema&amp;#39; is &amp;#39;The document format is not recognized (the content type is &amp;#39;text/html; charset=UTF-8&amp;#39;).&amp;#39;.
Metadata contains a reference that cannot be resolved: &amp;#39;http://MacB/WCF11/service1.svc&amp;#39;.
Content Type application/soap+xml; charset=utf-8 was not supported by service http://MacB/service1.svc.  The client and service bindings may be mismatched.
The remote server returned an error: (415) Unsupported Media Type.
If the service is defined in the current solution, try building the solution and adding the service reference again. 

:(

please help me out...
&lt;/p&gt;</description></item><item><title>Large WebResponse</title><link>http://forums.asp.net/thread/3467171.aspx</link><pubDate>Tue, 20 Oct 2009 12:20:09 GMT</pubDate><guid isPermaLink="false">4c671506-2930-414c-a40b-8bf57ded5924:3467171</guid><dc:creator>ido.ran</dc:creator><author>ido.ran</author><slash:comments>2</slash:comments><comments>http://forums.asp.net/thread/3467171.aspx</comments><wfw:commentRss>http://forums.asp.net/commentrss.aspx?SectionID=1180&amp;PostID=3467171</wfw:commentRss><description>&lt;p&gt;Hi,&lt;/p&gt;&lt;p&gt;I&amp;#39;m using REST starter kit to write a WPF client application which interact with RESTful web service implemented in Java using Glassfish v2.1 container.&lt;/p&gt;&lt;p&gt;I have tried different approaches for client side data usage as follow:&lt;/p&gt;&lt;p&gt;1. request only &amp;quot;one-level-deep&amp;quot; entity (for example customer) and only when properties of the customer are accessed retrieve the next level entity (for example customer type as sample of single entity, or list of orders of that customer as sample for list of entities).&lt;/p&gt;&lt;p&gt;2. request full-graph entity - for example when requesting that customer also get it&amp;#39;s customer-type entity and also all of it&amp;#39;s orders and their internal entity-graph.&lt;/p&gt;&lt;p&gt;&lt;br /&gt;&lt;/p&gt;&lt;p&gt;There is no better way, there is more suitable way for specific need. When I need to use all the information the second way is much (much much) faster because the overhead of HTTP call, de-serialization and more are only done once.&lt;/p&gt;&lt;p&gt;The problem I saw is that REST starter kit sometime hang when large response returned from the web-service. By large I mean 5MB or response.&lt;/p&gt;&lt;p&gt;&lt;br /&gt;&lt;/p&gt;&lt;p&gt;My question:&lt;/p&gt;&lt;p&gt;1. Is it bad to have such large response?&lt;/p&gt;&lt;p&gt;2. Does REST starter kit need to have all the answer before deserialization can occur?&lt;/p&gt;&lt;p&gt;3. What can be better way?&lt;/p&gt;&lt;p&gt;4. Currently I am using XML serialization, can JSON make a difference?&lt;/p&gt;&lt;p&gt;&lt;br /&gt;&lt;/p&gt;&lt;p&gt;Thank you very much,&lt;/p&gt;&lt;p&gt;Ido.&lt;/p&gt;</description></item><item><title>wcf and json 404 error</title><link>http://forums.asp.net/thread/3492620.aspx</link><pubDate>Tue, 03 Nov 2009 23:19:01 GMT</pubDate><guid isPermaLink="false">4c671506-2930-414c-a40b-8bf57ded5924:3492620</guid><dc:creator>dev14</dc:creator><author>dev14</author><slash:comments>1</slash:comments><comments>http://forums.asp.net/thread/3492620.aspx</comments><wfw:commentRss>http://forums.asp.net/commentrss.aspx?SectionID=1180&amp;PostID=3492620</wfw:commentRss><description>&lt;p&gt;I&amp;#39;m trying to call the WCF service(Different machine) from my local machine but no luck, returns 404&lt;/p&gt;&lt;p&gt;I want to call the same service using VS2005&lt;/p&gt;&lt;p&gt;&lt;br /&gt; there may be simple things missing but as I&amp;#39;m new to this couldn&amp;#39;t figure out.&lt;br /&gt; &lt;br /&gt; 1. WCFService.svc&lt;br /&gt; &lt;br /&gt; namespace WCFTest&lt;br /&gt; {&lt;br /&gt; &amp;nbsp;&amp;nbsp;&amp;nbsp; &lt;br /&gt; &amp;nbsp;&amp;nbsp;&amp;nbsp; public class WCFService : IWCFService&lt;br /&gt; &amp;nbsp;&amp;nbsp;&amp;nbsp; {&lt;br /&gt; &amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; public string HelloWorld(string strName)&lt;br /&gt; &amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; {&lt;br /&gt; &amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; return &amp;quot;Your Entered:&amp;quot;+strName;&lt;br /&gt; &amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; }&lt;br /&gt; &amp;nbsp;&amp;nbsp;&amp;nbsp; }&lt;br /&gt; }&lt;br /&gt; &lt;br /&gt; 2. WCFService.svc.cs&lt;br /&gt; &lt;br /&gt; namespace WCFTest&lt;br /&gt; {&lt;br /&gt; &amp;nbsp;&amp;nbsp;&amp;nbsp; &lt;br /&gt; &amp;nbsp;&amp;nbsp;&amp;nbsp; [ScriptService]&lt;br /&gt; &amp;nbsp;&amp;nbsp;&amp;nbsp; public class WCFService : IWCFService&lt;br /&gt; &amp;nbsp;&amp;nbsp;&amp;nbsp; {&lt;br /&gt; &amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; public string HelloWorld(string strName)&lt;br /&gt; &amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; {&lt;br /&gt; &amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; return &amp;quot;Your Entered:&amp;quot;+strName;&lt;br /&gt; &amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; }&lt;br /&gt; &amp;nbsp;&amp;nbsp;&amp;nbsp; }&lt;br /&gt; }&lt;br /&gt; &lt;br /&gt; 3. webconfig&lt;br /&gt; &lt;br /&gt; &amp;nbsp;&amp;nbsp;&amp;nbsp; &amp;lt;system.serviceModel&amp;gt;&lt;br /&gt; &amp;nbsp;&amp;nbsp;&amp;nbsp; &amp;nbsp;&amp;nbsp;&amp;nbsp; &amp;lt;bindings&amp;gt;&lt;br /&gt; &amp;nbsp;&amp;nbsp;&amp;nbsp; &amp;nbsp;&amp;nbsp;&amp;nbsp; &amp;nbsp;&amp;nbsp;&amp;nbsp; &amp;lt;webHttpBinding&amp;gt;&lt;br /&gt; &amp;nbsp;&amp;nbsp;&amp;nbsp; &amp;nbsp;&amp;nbsp;&amp;nbsp; &amp;nbsp;&amp;nbsp;&amp;nbsp; &amp;nbsp;&amp;nbsp;&amp;nbsp; &amp;lt;binding name=&amp;quot;jsonBinding&amp;quot; maxReceivedMessageSize=&amp;quot;2147483647&amp;quot;&amp;gt;&lt;br /&gt; &amp;nbsp;&amp;nbsp;&amp;nbsp; &amp;nbsp;&amp;nbsp;&amp;nbsp; &amp;nbsp;&amp;nbsp;&amp;nbsp; &amp;nbsp;&amp;nbsp;&amp;nbsp; &amp;lt;/binding&amp;gt;&lt;br /&gt; &amp;nbsp;&amp;nbsp;&amp;nbsp; &amp;nbsp;&amp;nbsp;&amp;nbsp; &amp;nbsp;&amp;nbsp;&amp;nbsp; &amp;lt;/webHttpBinding&amp;gt;&lt;br /&gt; &amp;nbsp;&amp;nbsp;&amp;nbsp; &amp;nbsp;&amp;nbsp;&amp;nbsp; &amp;lt;/bindings&amp;gt;&lt;br /&gt; &amp;nbsp;&amp;nbsp;&amp;nbsp; &amp;nbsp;&amp;nbsp;&amp;nbsp; &amp;lt;services&amp;gt;&lt;br /&gt; &amp;nbsp;&amp;nbsp;&amp;nbsp; &amp;nbsp;&amp;nbsp;&amp;nbsp; &amp;nbsp;&amp;nbsp;&amp;nbsp; &amp;lt;service behaviorConfiguration=&amp;quot;WCFTest.WCFServiceBehavior&amp;quot; name=&amp;quot;WCFTest.WCFService&amp;quot;&amp;gt;&lt;br /&gt;
&amp;nbsp;&amp;nbsp;&amp;nbsp; &amp;nbsp;&amp;nbsp;&amp;nbsp; &amp;nbsp;&amp;nbsp;&amp;nbsp; &amp;nbsp;&amp;nbsp;&amp;nbsp; &amp;lt;endpoint
address=&amp;quot;http://server:portnumber/WCFService.svc&amp;quot;
binding=&amp;quot;webHttpBinding&amp;quot; bindingConfiguration=&amp;quot;jsonBinding&amp;quot;
behaviorConfiguration=&amp;quot;jsonBehavior&amp;quot; name=&amp;quot;myservice&amp;quot;
contract=&amp;quot;WCFTest.IWCFService&amp;quot;&amp;gt;&lt;br /&gt; &amp;nbsp;&amp;nbsp;&amp;nbsp; &amp;nbsp;&amp;nbsp;&amp;nbsp; &amp;nbsp;&amp;nbsp;&amp;nbsp; &amp;nbsp;&amp;nbsp;&amp;nbsp; &amp;lt;/endpoint&amp;gt;&lt;br /&gt; &amp;nbsp;&amp;nbsp;&amp;nbsp; &amp;nbsp;&amp;nbsp;&amp;nbsp; &amp;nbsp;&amp;nbsp;&amp;nbsp; &amp;lt;/service&amp;gt;&lt;br /&gt; &amp;nbsp;&amp;nbsp;&amp;nbsp; &amp;nbsp;&amp;nbsp;&amp;nbsp; &amp;lt;/services&amp;gt;&lt;br /&gt; &amp;nbsp;&amp;nbsp;&amp;nbsp; &amp;nbsp;&amp;nbsp;&amp;nbsp; &amp;lt;behaviors&amp;gt;&lt;br /&gt; &amp;nbsp;&amp;nbsp;&amp;nbsp; &amp;nbsp;&amp;nbsp;&amp;nbsp; &amp;nbsp;&amp;nbsp;&amp;nbsp; &amp;lt;serviceBehaviors&amp;gt;&lt;br /&gt; &amp;nbsp;&amp;nbsp;&amp;nbsp; &amp;nbsp;&amp;nbsp;&amp;nbsp; &amp;nbsp;&amp;nbsp;&amp;nbsp; &amp;nbsp;&amp;nbsp;&amp;nbsp; &amp;lt;behavior name=&amp;quot;WCFTest.WCFServiceBehavior&amp;quot;&amp;gt;&lt;br /&gt; &amp;nbsp;&amp;nbsp;&amp;nbsp; &amp;nbsp;&amp;nbsp;&amp;nbsp; &amp;nbsp;&amp;nbsp;&amp;nbsp; &amp;nbsp;&amp;nbsp;&amp;nbsp; &amp;nbsp;&amp;nbsp;&amp;nbsp; &amp;lt;serviceMetadata httpGetEnabled=&amp;quot;true&amp;quot;/&amp;gt;&lt;br /&gt; &amp;nbsp;&amp;nbsp;&amp;nbsp; &amp;nbsp;&amp;nbsp;&amp;nbsp; &amp;nbsp;&amp;nbsp;&amp;nbsp; &amp;nbsp;&amp;nbsp;&amp;nbsp; &amp;nbsp;&amp;nbsp;&amp;nbsp; &amp;lt;serviceDebug includeExceptionDetailInFaults=&amp;quot;false&amp;quot;/&amp;gt;&lt;br /&gt; &amp;nbsp;&amp;nbsp;&amp;nbsp; &amp;nbsp;&amp;nbsp;&amp;nbsp; &amp;nbsp;&amp;nbsp;&amp;nbsp; &amp;nbsp;&amp;nbsp;&amp;nbsp; &amp;lt;/behavior&amp;gt;&lt;br /&gt; &amp;nbsp;&amp;nbsp;&amp;nbsp; &amp;nbsp;&amp;nbsp;&amp;nbsp; &amp;nbsp;&amp;nbsp;&amp;nbsp; &amp;lt;/serviceBehaviors&amp;gt;&lt;br /&gt; &amp;nbsp;&amp;nbsp;&amp;nbsp; &amp;nbsp;&amp;nbsp;&amp;nbsp; &amp;nbsp;&amp;nbsp;&amp;nbsp; &amp;lt;endpointBehaviors&amp;gt;&lt;br /&gt; &amp;nbsp;&amp;nbsp;&amp;nbsp; &amp;nbsp;&amp;nbsp;&amp;nbsp; &amp;nbsp;&amp;nbsp;&amp;nbsp; &amp;nbsp;&amp;nbsp;&amp;nbsp; &amp;lt;behavior name=&amp;quot;jsonBehavior&amp;quot;&amp;gt;&lt;br /&gt; &amp;nbsp;&amp;nbsp;&amp;nbsp; &amp;nbsp;&amp;nbsp;&amp;nbsp; &amp;nbsp;&amp;nbsp;&amp;nbsp; &amp;nbsp;&amp;nbsp;&amp;nbsp; &amp;nbsp;&amp;nbsp;&amp;nbsp; &amp;lt;enableWebScript/&amp;gt;&lt;br /&gt; &amp;nbsp;&amp;nbsp;&amp;nbsp; &amp;nbsp;&amp;nbsp;&amp;nbsp; &amp;nbsp;&amp;nbsp;&amp;nbsp; &amp;nbsp;&amp;nbsp;&amp;nbsp; &amp;lt;/behavior&amp;gt;&lt;br /&gt; &amp;nbsp;&amp;nbsp;&amp;nbsp; &amp;nbsp;&amp;nbsp;&amp;nbsp; &amp;nbsp;&amp;nbsp;&amp;nbsp; &amp;lt;/endpointBehaviors&amp;gt;&lt;br /&gt; &amp;nbsp;&amp;nbsp;&amp;nbsp; &amp;nbsp;&amp;nbsp;&amp;nbsp; &amp;lt;/behaviors&amp;gt;&lt;br /&gt; &amp;nbsp;&amp;nbsp;&amp;nbsp; &amp;lt;/system.serviceModel&amp;gt;&lt;br /&gt; &lt;br /&gt; &lt;br /&gt; ** The service is deployed on the server.&lt;br /&gt; &lt;br /&gt; 4. Created Defalut.aspx on my local machine&lt;br /&gt; &lt;br /&gt; &amp;lt;body onload=&amp;quot;Initialize();&amp;quot;&amp;gt;&lt;br /&gt; &amp;nbsp;&amp;nbsp;&amp;nbsp; &amp;lt;form id=&amp;quot;form1&amp;quot; runat=&amp;quot;server&amp;quot;&amp;gt;&lt;br /&gt; &amp;nbsp;&amp;nbsp;&amp;nbsp; &amp;lt;asp:ScriptManager ID=&amp;quot;ScriptManager1&amp;quot; runat=&amp;quot;server&amp;quot; EnablePageMethods=&amp;quot;true&amp;quot;&amp;gt;&lt;br /&gt; &amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; &amp;lt;Services&amp;gt;&lt;br /&gt; &amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; &amp;lt;asp:ServiceReference Path=&amp;quot;http://server:portnumber/WCFService.svc&amp;quot;/&amp;gt;&lt;br /&gt; &amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; &amp;lt;/Services&amp;gt;&lt;br /&gt; &amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; &amp;lt;Scripts&amp;gt;&lt;br /&gt; &amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; &amp;lt;asp:ScriptReference Path=&amp;quot;~/test.js&amp;quot;/&amp;gt;&lt;br /&gt; &amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; &amp;lt;/Scripts&amp;gt;&lt;br /&gt; &amp;nbsp;&amp;nbsp;&amp;nbsp; &amp;lt;/asp:ScriptManager&amp;gt;&lt;br /&gt; &amp;nbsp;&amp;nbsp;&amp;nbsp; &amp;lt;div&amp;gt;&lt;br /&gt; &amp;nbsp;&amp;nbsp;&amp;nbsp; &amp;lt;label&amp;gt;Greetings:&amp;lt;/label&amp;gt;&amp;lt;asp:Label ID=&amp;quot;lblShow&amp;quot; runat=&amp;quot;server&amp;quot;&amp;gt;&amp;lt;/asp:Label&amp;gt;&lt;br /&gt; &amp;nbsp;&amp;nbsp;&amp;nbsp; &amp;lt;/div&amp;gt;&lt;br /&gt; &amp;nbsp;&amp;nbsp;&amp;nbsp; &amp;lt;/form&amp;gt;&lt;br /&gt; &amp;lt;/body&amp;gt;&lt;br /&gt; &lt;br /&gt; 5. Created test.js on my local machine&lt;br /&gt; &lt;br /&gt; function Initialize() {&lt;br /&gt; &amp;nbsp;&amp;nbsp;&amp;nbsp; var proxy = new WCFTest.IWCFService();&lt;br /&gt; &amp;nbsp;&amp;nbsp;&amp;nbsp; proxy.HelloWorld(&amp;quot;YOurName&amp;quot;,OnSuccess, OnFailure);&lt;br /&gt; }&lt;br /&gt; &lt;br /&gt; function OnSuccess(result) {&lt;br /&gt; &amp;nbsp;&amp;nbsp;&amp;nbsp; document.getElementById(&amp;#39;lblShow&amp;#39;).innerHTML = result;&lt;br /&gt; }&lt;br /&gt; &lt;br /&gt; function OnFailure(result) {&lt;br /&gt; &amp;nbsp;&amp;nbsp;&amp;nbsp; alert(&amp;#39;Failed&amp;#39;);&lt;br /&gt; }&lt;br /&gt; &lt;br /&gt; 6. Result: &amp;quot;The server method &amp;#39;HelloWorld&amp;#39; failed.&amp;quot; &lt;br /&gt; &lt;br /&gt; Using Firebug:&lt;br /&gt; &lt;br /&gt; **Response Headers&lt;br /&gt; &lt;br /&gt; Server&amp;nbsp;&amp;nbsp;&amp;nbsp; ASP.NET Development Server/9.0.0.0&lt;br /&gt; Date&amp;nbsp;&amp;nbsp;&amp;nbsp; Tue, 03 Nov 2009 20:48:12 GMT&lt;br /&gt; Content-Length&amp;nbsp;&amp;nbsp;&amp;nbsp; 1210&lt;br /&gt; Connection&amp;nbsp;&amp;nbsp;&amp;nbsp; Close&lt;br /&gt; &lt;br /&gt; &lt;br /&gt; **Request Headers&lt;br /&gt; &lt;br /&gt; Host&amp;nbsp;&amp;nbsp;&amp;nbsp; localhost:4007&lt;br /&gt; User-Agent&amp;nbsp;&amp;nbsp;&amp;nbsp; Mozilla/5.0 (Windows; U; Windows NT 5.1; en-US; rv:1.9.1.4) Gecko/20091016 Firefox/3.5.4 (.NET CLR 3.5.30729)&lt;br /&gt; Accept&amp;nbsp;&amp;nbsp;&amp;nbsp; text/html,application/xhtml+xml,application/xml;q=0.9,*/*;q=0.8&lt;br /&gt; Accept-Language&amp;nbsp;&amp;nbsp;&amp;nbsp; en-us,en;q=0.5&lt;br /&gt; Accept-Encoding&amp;nbsp;&amp;nbsp;&amp;nbsp; gzip,deflate&lt;br /&gt; Accept-Charset&amp;nbsp;&amp;nbsp;&amp;nbsp; ISO-8859-1,utf-8;q=0.7,*;q=0.7&lt;br /&gt; Keep-Alive&amp;nbsp;&amp;nbsp;&amp;nbsp; 300&lt;br /&gt; Connection&amp;nbsp;&amp;nbsp;&amp;nbsp; keep-alive&lt;br /&gt; Content-Type&amp;nbsp;&amp;nbsp;&amp;nbsp; application/json; charset=utf-8&lt;br /&gt; Referer&amp;nbsp;&amp;nbsp;&amp;nbsp; http://localhost:4007/MyTest/Default.aspx&lt;br /&gt; Content-Length&amp;nbsp;&amp;nbsp;&amp;nbsp; 20&lt;br /&gt; &lt;br /&gt; **POST&lt;br /&gt; {&amp;quot;strName&amp;quot;:&amp;quot;YOurName&amp;quot;}&lt;br /&gt; &lt;br /&gt; **Response&lt;br /&gt; &lt;br /&gt; &amp;lt;html&amp;gt;&lt;br /&gt; &amp;nbsp;&amp;nbsp;&amp;nbsp; &amp;lt;head&amp;gt;&lt;br /&gt; &amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; &amp;lt;title&amp;gt;Not Found&amp;lt;/title&amp;gt;&lt;br /&gt; &amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; &amp;lt;style&amp;gt;&lt;br /&gt; &amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; &amp;nbsp;&amp;nbsp;&amp;nbsp; body {font-family:&amp;quot;Verdana&amp;quot;;font-weight:normal;font-size: 8pt;color:black;} &lt;br /&gt; &amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; &amp;nbsp;&amp;nbsp;&amp;nbsp; p {font-family:&amp;quot;Verdana&amp;quot;;font-weight:normal;color:black;margin-top: -5px}&lt;br /&gt; &amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; &amp;nbsp;&amp;nbsp;&amp;nbsp; b {font-family:&amp;quot;Verdana&amp;quot;;font-weight:bold;color:black;margin-top: -5px}&lt;br /&gt; &amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; &amp;nbsp;&amp;nbsp;&amp;nbsp; h1 { font-family:&amp;quot;Verdana&amp;quot;;font-weight:normal;font-size:18pt;color:red }&lt;br /&gt; &amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; &amp;nbsp;&amp;nbsp;&amp;nbsp; h2 { font-family:&amp;quot;Verdana&amp;quot;;font-weight:normal;font-size:14pt;color:maroon }&lt;br /&gt; &amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; &amp;nbsp;&amp;nbsp;&amp;nbsp; pre {font-family:&amp;quot;Lucida Console&amp;quot;;font-size: 8pt}&lt;br /&gt; &amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; &amp;nbsp;&amp;nbsp;&amp;nbsp; .marker {font-weight: bold; color: black;text-decoration: none;}&lt;br /&gt; &amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; &amp;nbsp;&amp;nbsp;&amp;nbsp; .version {color: gray;}&lt;br /&gt; &amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; &amp;nbsp;&amp;nbsp;&amp;nbsp; .error {margin-bottom: 10px;}&lt;br /&gt; &amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; &amp;nbsp;&amp;nbsp;&amp;nbsp; .expandable { text-decoration:underline; font-weight:bold; color:navy; cursor:hand; }&lt;br /&gt; &amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; &amp;lt;/style&amp;gt;&lt;br /&gt; &amp;nbsp;&amp;nbsp;&amp;nbsp; &amp;lt;/head&amp;gt;&lt;br /&gt; &amp;nbsp;&amp;nbsp;&amp;nbsp; &amp;lt;body bgcolor=&amp;quot;white&amp;quot;&amp;gt;&lt;br /&gt; &lt;br /&gt; &amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; &amp;lt;span&amp;gt;&amp;lt;h1&amp;gt;Server Error in &amp;#39;/MyTest&amp;#39; Application.&amp;lt;hr width=100% size=1 color=silver&amp;gt;&amp;lt;/h1&amp;gt;&lt;br /&gt; &lt;br /&gt; &amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; &amp;lt;h2&amp;gt; &amp;lt;i&amp;gt;HTTP Error 404 - Not Found.&amp;lt;/i&amp;gt; &amp;lt;/h2&amp;gt;&amp;lt;/span&amp;gt;&lt;br /&gt; &lt;br /&gt; &amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; &amp;lt;hr width=100% size=1 color=silver&amp;gt;&lt;br /&gt; &lt;br /&gt; &amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; &amp;lt;b&amp;gt;Version Information:&amp;lt;/b&amp;gt;&amp;amp;nbsp;ASP.NET Development Server 9.0.0.0&lt;br /&gt; &lt;br /&gt; &amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; &amp;lt;/font&amp;gt;&lt;br /&gt; &lt;br /&gt; &amp;nbsp;&amp;nbsp;&amp;nbsp; &amp;lt;/body&amp;gt;&lt;br /&gt; &amp;lt;/html&amp;gt;&lt;br /&gt; &lt;br /&gt; &lt;br /&gt; The URL it is trying to hit is &lt;br /&gt; &lt;br /&gt; POST http://localhost:4007/WCFService.svc/HelloWorld&lt;br /&gt; &lt;br /&gt; thanks.&lt;br /&gt;&lt;/p&gt;</description></item><item><title>Cannnot access .svc on a RESTFul WCF Service deployed on local IIS WebServer</title><link>http://forums.asp.net/thread/3482312.aspx</link><pubDate>Wed, 28 Oct 2009 19:29:10 GMT</pubDate><guid isPermaLink="false">4c671506-2930-414c-a40b-8bf57ded5924:3482312</guid><dc:creator>praticalCoder</dc:creator><author>praticalCoder</author><slash:comments>1</slash:comments><comments>http://forums.asp.net/thread/3482312.aspx</comments><wfw:commentRss>http://forums.asp.net/commentrss.aspx?SectionID=1180&amp;PostID=3482312</wfw:commentRss><description>&lt;p&gt;&lt;br /&gt;Hey Guys n Gals,&lt;br /&gt;&lt;br /&gt;I need help, I&amp;#39;m new to the WCF world having recently made the transition from SOAP Webservices.&lt;br /&gt;&lt;br /&gt;The WCF service works well when I run in from the VS2008 ASP.NET Development Server i.e. Debug Mode. The problem comes when I try to access the service via IIS.&lt;br /&gt;&lt;br /&gt;I&amp;#39;ve setup a website on my local IIS Webserver hosted on port 8082 (http://localhost:8082) and have created a VirtualDirectory (1.0) that points to the physical directory that contains my WCF Service code. The Website is setup to do ASP.NET 2.0.50727. I can get to the landing page and also an assortment of .aspx pages but when I try to access the Service.svc, the browser never gets there and just sits idling.&lt;br /&gt;&lt;br /&gt;http://localhost:8082/1.0/Service.svc&lt;br /&gt;&lt;br /&gt;My question is what setup am I missing to get the service to work from inside IIS since I already know it works under the development server.&lt;br /&gt;&lt;br /&gt;I&amp;#39;m attaching part of my web.config if that would help.&lt;br /&gt;&lt;br /&gt;&lt;pre name="code" class="c-sharp"&gt;&amp;lt;system.serviceModel&amp;gt;
    &amp;lt;services&amp;gt;
        &amp;lt;service name=&amp;quot;Service1&amp;quot; behaviorConfiguration=&amp;quot;Service1Behavior&amp;quot;&amp;gt;
            &amp;lt;!-- Service Endpoints --&amp;gt;
            &amp;lt;endpoint address=&amp;quot;&amp;quot; binding=&amp;quot;wsHttpBinding&amp;quot; contract=&amp;quot;IService1&amp;quot;&amp;gt;
                &amp;lt;!--
          Upon deployment, the following identity element should be removed or replaced to reflect the
          identity under which the deployed service runs.  If removed, WCF will infer an appropriate identity
          automatically.
      --&amp;gt;
                &amp;lt;identity&amp;gt;
                    &amp;lt;dns value=&amp;quot;localhost&amp;quot;/&amp;gt;
                &amp;lt;/identity&amp;gt;
            &amp;lt;/endpoint&amp;gt;
            &amp;lt;endpoint address=&amp;quot;mex&amp;quot; binding=&amp;quot;mexHttpBinding&amp;quot; contract=&amp;quot;IMetadataExchange&amp;quot;/&amp;gt;
        &amp;lt;/service&amp;gt;
    &amp;lt;/services&amp;gt;
    &amp;lt;behaviors&amp;gt;
        &amp;lt;serviceBehaviors&amp;gt;
            &amp;lt;behavior name=&amp;quot;Service1Behavior&amp;quot;&amp;gt;
                &amp;lt;!-- To avoid disclosing metadata information, set the value below to false and remove the metadata endpoint above before deployment --&amp;gt;
                &amp;lt;serviceMetadata httpGetEnabled=&amp;quot;true&amp;quot;/&amp;gt;
                &amp;lt;!-- To receive exception details in faults for debugging purposes, set the value below to true.  Set to false before deployment to avoid disclosing exception information --&amp;gt;
                &amp;lt;serviceDebug includeExceptionDetailInFaults=&amp;quot;true&amp;quot;/&amp;gt;
            &amp;lt;/behavior&amp;gt;
        &amp;lt;/serviceBehaviors&amp;gt;
    &amp;lt;/behaviors&amp;gt;
&amp;lt;/system.serviceModel&amp;gt;&lt;/pre&gt;&lt;br /&gt; &lt;br /&gt;&lt;/p&gt;&lt;p&gt;&lt;/p&gt;&lt;div id="refHTML"&gt;&lt;/div&gt;</description></item><item><title>How do I set "allowCookies=true" </title><link>http://forums.asp.net/thread/3460604.aspx</link><pubDate>Thu, 15 Oct 2009 18:40:03 GMT</pubDate><guid isPermaLink="false">4c671506-2930-414c-a40b-8bf57ded5924:3460604</guid><dc:creator>prgscd</dc:creator><author>prgscd</author><slash:comments>4</slash:comments><comments>http://forums.asp.net/thread/3460604.aspx</comments><wfw:commentRss>http://forums.asp.net/commentrss.aspx?SectionID=1180&amp;PostID=3460604</wfw:commentRss><description>&lt;p&gt;&amp;nbsp;How do I set &amp;quot;allowCookies=true&amp;quot; in code with the WCF REST Starter kit, without using the declarative model (setting it in the app.config) file?&lt;/p&gt;</description></item><item><title>WCF Service - coexist as Windows and as Web Service?</title><link>http://forums.asp.net/thread/3457573.aspx</link><pubDate>Wed, 14 Oct 2009 11:06:00 GMT</pubDate><guid isPermaLink="false">4c671506-2930-414c-a40b-8bf57ded5924:3457573</guid><dc:creator>dvd.ribeiro</dc:creator><author>dvd.ribeiro</author><slash:comments>2</slash:comments><comments>http://forums.asp.net/thread/3457573.aspx</comments><wfw:commentRss>http://forums.asp.net/commentrss.aspx?SectionID=1180&amp;PostID=3457573</wfw:commentRss><description>&lt;p&gt;Hi, I have a WCF simple service (calculator), and I created the code for it as a Windows Service. It has the interface, the service, and a windowsservice.cs class like this:&lt;/p&gt;&lt;p&gt;&lt;/p&gt;&lt;div style="position:absolute;left:-10000px;width:1px;height:1px;overflow-x:hidden;overflow-y:hidden;top:0px;" id="_mcePaste"&gt;public class CalculatorWindowsService : ServiceBase&lt;/div&gt;
&lt;div style="position:absolute;left:-10000px;width:1px;height:1px;overflow-x:hidden;overflow-y:hidden;top:0px;" id="_mcePaste"&gt;    {&lt;/div&gt;
&lt;div style="position:absolute;left:-10000px;width:1px;height:1px;overflow-x:hidden;overflow-y:hidden;top:0px;" id="_mcePaste"&gt;        public ServiceHost serviceHost = null;&lt;/div&gt;
&lt;div style="position:absolute;left:-10000px;width:1px;height:1px;overflow-x:hidden;overflow-y:hidden;top:0px;" id="_mcePaste"&gt;&lt;/div&gt;
&lt;div style="position:absolute;left:-10000px;width:1px;height:1px;overflow-x:hidden;overflow-y:hidden;top:0px;" id="_mcePaste"&gt;        public CalculatorWindowsService()&lt;/div&gt;
&lt;div style="position:absolute;left:-10000px;width:1px;height:1px;overflow-x:hidden;overflow-y:hidden;top:0px;" id="_mcePaste"&gt;        {&lt;/div&gt;
&lt;div style="position:absolute;left:-10000px;width:1px;height:1px;overflow-x:hidden;overflow-y:hidden;top:0px;" id="_mcePaste"&gt;            // Name the Windows Service&lt;/div&gt;
&lt;div style="position:absolute;left:-10000px;width:1px;height:1px;overflow-x:hidden;overflow-y:hidden;top:0px;" id="_mcePaste"&gt;            ServiceName = &amp;quot;WCFWindowsCalculatorService&amp;quot;;&lt;/div&gt;
&lt;div style="position:absolute;left:-10000px;width:1px;height:1px;overflow-x:hidden;overflow-y:hidden;top:0px;" id="_mcePaste"&gt;        }&lt;/div&gt;
&lt;div style="position:absolute;left:-10000px;width:1px;height:1px;overflow-x:hidden;overflow-y:hidden;top:0px;" id="_mcePaste"&gt;&lt;/div&gt;
&lt;div style="position:absolute;left:-10000px;width:1px;height:1px;overflow-x:hidden;overflow-y:hidden;top:0px;" id="_mcePaste"&gt;        public static void Main()&lt;/div&gt;
&lt;div style="position:absolute;left:-10000px;width:1px;height:1px;overflow-x:hidden;overflow-y:hidden;top:0px;" id="_mcePaste"&gt;        {&lt;/div&gt;
&lt;div style="position:absolute;left:-10000px;width:1px;height:1px;overflow-x:hidden;overflow-y:hidden;top:0px;" id="_mcePaste"&gt;            ServiceBase.Run(new CalculatorWindowsService());&lt;/div&gt;
&lt;div style="position:absolute;left:-10000px;width:1px;height:1px;overflow-x:hidden;overflow-y:hidden;top:0px;" id="_mcePaste"&gt;        }&lt;/div&gt;
&lt;div style="position:absolute;left:-10000px;width:1px;height:1px;overflow-x:hidden;overflow-y:hidden;top:0px;" id="_mcePaste"&gt;&lt;/div&gt;
&lt;div style="position:absolute;left:-10000px;width:1px;height:1px;overflow-x:hidden;overflow-y:hidden;top:0px;" id="_mcePaste"&gt;&lt;/div&gt;
&lt;div style="position:absolute;left:-10000px;width:1px;height:1px;overflow-x:hidden;overflow-y:hidden;top:0px;" id="_mcePaste"&gt;        // Start the Windows service.&lt;/div&gt;
&lt;div style="position:absolute;left:-10000px;width:1px;height:1px;overflow-x:hidden;overflow-y:hidden;top:0px;" id="_mcePaste"&gt;        protected override void OnStart(string[] args)&lt;/div&gt;
&lt;div style="position:absolute;left:-10000px;width:1px;height:1px;overflow-x:hidden;overflow-y:hidden;top:0px;" id="_mcePaste"&gt;        {&lt;/div&gt;
&lt;div style="position:absolute;left:-10000px;width:1px;height:1px;overflow-x:hidden;overflow-y:hidden;top:0px;" id="_mcePaste"&gt;            if (serviceHost != null)&lt;/div&gt;
&lt;div style="position:absolute;left:-10000px;width:1px;height:1px;overflow-x:hidden;overflow-y:hidden;top:0px;" id="_mcePaste"&gt;            {&lt;/div&gt;
&lt;div style="position:absolute;left:-10000px;width:1px;height:1px;overflow-x:hidden;overflow-y:hidden;top:0px;" id="_mcePaste"&gt;                serviceHost.Close();&lt;/div&gt;
&lt;div style="position:absolute;left:-10000px;width:1px;height:1px;overflow-x:hidden;overflow-y:hidden;top:0px;" id="_mcePaste"&gt;            }&lt;/div&gt;
&lt;div style="position:absolute;left:-10000px;width:1px;height:1px;overflow-x:hidden;overflow-y:hidden;top:0px;" id="_mcePaste"&gt;&lt;/div&gt;
&lt;div style="position:absolute;left:-10000px;width:1px;height:1px;overflow-x:hidden;overflow-y:hidden;top:0px;" id="_mcePaste"&gt;            // Create a ServiceHost for the CalculatorService type and &lt;/div&gt;
&lt;div style="position:absolute;left:-10000px;width:1px;height:1px;overflow-x:hidden;overflow-y:hidden;top:0px;" id="_mcePaste"&gt;            // provide the base address.&lt;/div&gt;
&lt;div style="position:absolute;left:-10000px;width:1px;height:1px;overflow-x:hidden;overflow-y:hidden;top:0px;" id="_mcePaste"&gt;            serviceHost = new ServiceHost(typeof(CalculatorService));&lt;/div&gt;
&lt;div style="position:absolute;left:-10000px;width:1px;height:1px;overflow-x:hidden;overflow-y:hidden;top:0px;" id="_mcePaste"&gt;&lt;/div&gt;
&lt;div style="position:absolute;left:-10000px;width:1px;height:1px;overflow-x:hidden;overflow-y:hidden;top:0px;" id="_mcePaste"&gt;            // Open the ServiceHostBase to create listeners and start &lt;/div&gt;
&lt;div style="position:absolute;left:-10000px;width:1px;height:1px;overflow-x:hidden;overflow-y:hidden;top:0px;" id="_mcePaste"&gt;            // listening for messages.&lt;/div&gt;
&lt;div style="position:absolute;left:-10000px;width:1px;height:1px;overflow-x:hidden;overflow-y:hidden;top:0px;" id="_mcePaste"&gt;            serviceHost.Open();&lt;/div&gt;
&lt;div style="position:absolute;left:-10000px;width:1px;height:1px;overflow-x:hidden;overflow-y:hidden;top:0px;" id="_mcePaste"&gt;        }&lt;/div&gt;
&lt;div style="position:absolute;left:-10000px;width:1px;height:1px;overflow-x:hidden;overflow-y:hidden;top:0px;" id="_mcePaste"&gt;&lt;/div&gt;
&lt;div style="position:absolute;left:-10000px;width:1px;height:1px;overflow-x:hidden;overflow-y:hidden;top:0px;" id="_mcePaste"&gt;        protected override void OnStop()&lt;/div&gt;
&lt;div style="position:absolute;left:-10000px;width:1px;height:1px;overflow-x:hidden;overflow-y:hidden;top:0px;" id="_mcePaste"&gt;        {&lt;/div&gt;
&lt;div style="position:absolute;left:-10000px;width:1px;height:1px;overflow-x:hidden;overflow-y:hidden;top:0px;" id="_mcePaste"&gt;            if (serviceHost != null)&lt;/div&gt;
&lt;div style="position:absolute;left:-10000px;width:1px;height:1px;overflow-x:hidden;overflow-y:hidden;top:0px;" id="_mcePaste"&gt;            {&lt;/div&gt;
&lt;div style="position:absolute;left:-10000px;width:1px;height:1px;overflow-x:hidden;overflow-y:hidden;top:0px;" id="_mcePaste"&gt;                serviceHost.Close();&lt;/div&gt;
&lt;div style="position:absolute;left:-10000px;width:1px;height:1px;overflow-x:hidden;overflow-y:hidden;top:0px;" id="_mcePaste"&gt;                serviceHost = null;&lt;/div&gt;
&lt;div style="position:absolute;left:-10000px;width:1px;height:1px;overflow-x:hidden;overflow-y:hidden;top:0px;" id="_mcePaste"&gt;            }&lt;/div&gt;
&lt;div style="position:absolute;left:-10000px;width:1px;height:1px;overflow-x:hidden;overflow-y:hidden;top:0px;" id="_mcePaste"&gt;        }&lt;/div&gt;
&lt;div style="position:absolute;left:-10000px;width:1px;height:1px;overflow-x:hidden;overflow-y:hidden;top:0px;" id="_mcePaste"&gt;    }&lt;/div&gt;&lt;p&gt;&lt;p&gt;public class CalculatorWindowsService : ServiceBase&lt;/p&gt;&lt;p&gt;    {&lt;/p&gt;&lt;p&gt;        public ServiceHost serviceHost = null;&lt;/p&gt;&lt;p&gt;&lt;br /&gt;&lt;/p&gt;&lt;p&gt;        public CalculatorWindowsService()&lt;/p&gt;&lt;p&gt;        {&lt;/p&gt;&lt;p&gt;            // Name the Windows Service&lt;/p&gt;&lt;p&gt;            ServiceName = &amp;quot;WCFWindowsCalculatorService&amp;quot;;&lt;/p&gt;&lt;p&gt;        }&lt;/p&gt;&lt;p&gt;&lt;br /&gt;&lt;/p&gt;&lt;p&gt;        public static void Main()&lt;/p&gt;&lt;p&gt;        {&lt;/p&gt;&lt;p&gt;            ServiceBase.Run(new CalculatorWindowsService());&lt;/p&gt;&lt;p&gt;        }&lt;/p&gt;&lt;p&gt;&lt;br /&gt;&lt;/p&gt;&lt;p&gt;&lt;br /&gt;&lt;/p&gt;&lt;p&gt;        // Start the Windows service.&lt;/p&gt;&lt;p&gt;        protected override void OnStart(string[] args)&lt;/p&gt;&lt;p&gt;        {&lt;/p&gt;&lt;p&gt;            if (serviceHost != null)&lt;/p&gt;&lt;p&gt;            {&lt;/p&gt;&lt;p&gt;                serviceHost.Close();&lt;/p&gt;&lt;p&gt;            }&lt;/p&gt;&lt;p&gt;&lt;br /&gt;&lt;/p&gt;&lt;p&gt;            // Create a ServiceHost for the CalculatorService type and &lt;/p&gt;&lt;p&gt;            // provide the base address.&lt;/p&gt;&lt;p&gt;            serviceHost = new ServiceHost(typeof(CalculatorService));&lt;/p&gt;&lt;p&gt;&lt;br /&gt;&lt;/p&gt;&lt;p&gt;            // Open the ServiceHostBase to create listeners and start &lt;/p&gt;&lt;p&gt;            // listening for messages.&lt;/p&gt;&lt;p&gt;            serviceHost.Open();&lt;/p&gt;&lt;p&gt;        }&lt;/p&gt;&lt;p&gt;&lt;br /&gt;&lt;/p&gt;&lt;p&gt;        protected override void OnStop()&lt;/p&gt;&lt;p&gt;        {&lt;/p&gt;&lt;p&gt;            if (serviceHost != null)&lt;/p&gt;&lt;p&gt;            {&lt;/p&gt;&lt;p&gt;                serviceHost.Close();&lt;/p&gt;&lt;p&gt;                serviceHost = null;&lt;/p&gt;&lt;p&gt;            }&lt;/p&gt;&lt;p&gt;        }&lt;/p&gt;&lt;p&gt;    }&lt;/p&gt;&lt;/p&gt;&lt;p&gt;&lt;br /&gt;&lt;/p&gt;&lt;p&gt;The thing is, that this code is mainly made for Windows Services.&lt;/p&gt;&lt;p&gt;&lt;br /&gt;&lt;/p&gt;&lt;p&gt;How do I also make code to use this same service both as Windows service and as Web Service?&lt;/p&gt;&lt;p&gt;I&amp;#39;m new at WCF, trying to figure out some differences in technical terms...&lt;/p&gt;&lt;p&gt;Thank you a lot!&lt;/p&gt;&lt;p&gt;&lt;/p&gt;&lt;p&gt;&lt;br /&gt;&lt;/p&gt;</description></item><item><title>Image Handling In WCF RESt Part -2</title><link>http://forums.asp.net/thread/3462756.aspx</link><pubDate>Fri, 16 Oct 2009 23:49:51 GMT</pubDate><guid isPermaLink="false">4c671506-2930-414c-a40b-8bf57ded5924:3462756</guid><dc:creator>snehitn</dc:creator><author>snehitn</author><slash:comments>0</slash:comments><comments>http://forums.asp.net/thread/3462756.aspx</comments><wfw:commentRss>http://forums.asp.net/commentrss.aspx?SectionID=1180&amp;PostID=3462756</wfw:commentRss><description>&lt;p&gt;Hi guys!&lt;/p&gt;&lt;p&gt;A sincere thanks to everyone who helped me understand the image retrieval from WCF REst Service and helped me, get it working.&amp;nbsp;&lt;/p&gt;&lt;p&gt;Now i have started working on Image upload program and i read through Carlos&amp;#39;s blog on this link.&lt;/p&gt;&lt;p&gt;&lt;a href="http://blogs.msdn.com/carlosfigueira/archive/2008/04/17/wcf-raw-programming-model-receiving-arbitrary-data.aspx"&gt;http://blogs.msdn.com/carlosfigueira/archive/2008/04/17/wcf-raw-programming-model-receiving-arbitrary-data.aspx&lt;/a&gt;&lt;/p&gt;&lt;p&gt;I have written the contract for Image Upload or the &amp;quot;POST&amp;quot; request.&lt;/p&gt;&lt;p&gt;My question is how do i test it? Should i write the TEST code as suggested in the blog in the main service itself or should i write a new client for it? IF so is there any example &amp;nbsp;of a client that you might know which might help me?&lt;/p&gt;&lt;p&gt;Broadly my question is: - how do i test the &amp;quot;POST&amp;quot; request for my service for an image?&lt;/p&gt;&lt;p&gt;Appreciate all the help i can get.&lt;/p&gt;&lt;p&gt;&lt;br /&gt;&lt;/p&gt;&lt;p&gt;&lt;br /&gt;&lt;/p&gt;&lt;p&gt;&lt;br /&gt;&amp;nbsp;&lt;/p&gt;</description></item><item><title>WCF REST Starter Kit2 POST Method Not Allowed 405 Code</title><link>http://forums.asp.net/thread/3456979.aspx</link><pubDate>Wed, 14 Oct 2009 06:00:18 GMT</pubDate><guid isPermaLink="false">4c671506-2930-414c-a40b-8bf57ded5924:3456979</guid><dc:creator>chintupawan</dc:creator><author>chintupawan</author><slash:comments>5</slash:comments><comments>http://forums.asp.net/thread/3456979.aspx</comments><wfw:commentRss>http://forums.asp.net/commentrss.aspx?SectionID=1180&amp;PostID=3456979</wfw:commentRss><description>&lt;p&gt;Hello every one.&lt;/p&gt;&lt;p&gt;I have downloaded WCF REST Starter Kit2 and created a Rest Collection Service application using default template it is working well. I tried  GET and POST Data this is ok. Now In Code behind page of Service .svc I removed those Default CollectionServiceBase&amp;lt;SampleItem&amp;gt; and ICollectionService&amp;lt;SampleItem&amp;gt; and added my own IPostalContract. Now I am not able to POST DATA it is saying Method Not Allowed but GET is working fine.&lt;br /&gt;&lt;/p&gt;&lt;p&gt;[ServiceContract]&lt;br /&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp; public interface IPostContract&lt;br /&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp; {&lt;br /&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; [OperationContract]&lt;br /&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; [WebGet(UriTemplate = &amp;quot;post/{id}&amp;quot;)]&lt;br /&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; Post GetPost(string id);&lt;br /&gt;&lt;br /&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; [OperationContract]&lt;br /&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; [WebGet(UriTemplate = &amp;quot;posts&amp;quot;)]&lt;br /&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; PostCollections GetPosts();&lt;br /&gt;&lt;br /&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; [OperationContract]&lt;br /&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; [WebInvoke(Method = &amp;quot;Post&amp;quot;, UriTemplate = &amp;quot;&amp;quot;, BodyStyle = WebMessageBodyStyle.Wrapped , ResponseFormat=WebMessageFormat.Xml)]&lt;br /&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; PostCollections AddPost(Post post);&lt;br /&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp; }&lt;/p&gt;&lt;p&gt;and I implemented this in codebehind page of Service.svc like this&lt;/p&gt;&lt;p&gt;Markup is this&lt;/p&gt;&lt;p&gt; &amp;lt;%@ ServiceHost Language=&amp;quot;C#&amp;quot; Debug=&amp;quot;true&amp;quot; Service=&amp;quot;Geeks_Lounge_Services.Service&amp;quot; Factory=&amp;quot;Microsoft.ServiceModel.Web.WebServiceHost2Factory&amp;quot;%&amp;gt;&lt;/p&gt;&lt;p&gt;[ServiceBehavior(IncludeExceptionDetailInFaults = true, InstanceContextMode = InstanceContextMode.Single, ConcurrencyMode = ConcurrencyMode.Single)]&lt;br /&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp; [AspNetCompatibilityRequirements(RequirementsMode = AspNetCompatibilityRequirementsMode.Allowed)]&lt;br /&gt;&amp;nbsp;&amp;nbsp; public class Service:IPostContract &lt;br /&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp; {&lt;br /&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; // TODO: These variables are used by the sample implementation. Remove if needed&lt;br /&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; &lt;br /&gt;&lt;br /&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; &lt;br /&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; public Post GetPost(string id)&lt;br /&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; {&lt;br /&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; // TODO: Change the sample implementation here&lt;br /&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; PostDS ds = new PostDS();&lt;br /&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; Post p = ds.GetSingle(Convert.ToInt32(id));&lt;br /&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; return p;&lt;br /&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; }&lt;br /&gt;&lt;br /&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; &lt;br /&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; public PostCollections GetPosts()&lt;br /&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; {&lt;br /&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; // TODO: Change the sample implementation here&lt;br /&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; PostDS ds = new PostDS();&lt;br /&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; PostCollections p = ds.GetAll();&lt;br /&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; return p;&lt;br /&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; }&lt;br /&gt;&lt;br /&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; public PostCollections AddPost(Post p)&lt;br /&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; {&lt;br /&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; PostDS ds = new PostDS();&lt;br /&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; return ds.AddPost(p);&lt;br /&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; }&lt;br /&gt;&amp;nbsp;&amp;nbsp; }&lt;/p&gt;&lt;p&gt;Web Config is as it is&lt;/p&gt;&lt;p&gt;&amp;lt;?xml version=&amp;quot;1.0&amp;quot;?&amp;gt;&lt;br /&gt;&amp;lt;configuration&amp;gt;&lt;br /&gt;&amp;nbsp;&amp;nbsp; &amp;nbsp;&amp;lt;system.web&amp;gt;&lt;br /&gt;&amp;nbsp;&amp;nbsp; &amp;nbsp;&amp;nbsp;&amp;nbsp; &amp;nbsp;&amp;lt;compilation debug=&amp;quot;true&amp;quot;/&amp;gt;&lt;br /&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; &amp;lt;/system.web&amp;gt;&lt;br /&gt;&amp;nbsp;&amp;nbsp; &amp;nbsp;&amp;lt;system.serviceModel&amp;gt;&lt;br /&gt;&amp;nbsp;&amp;nbsp; &amp;nbsp;&amp;nbsp;&amp;nbsp; &amp;nbsp;&amp;lt;serviceHostingEnvironment aspNetCompatibilityEnabled=&amp;quot;true&amp;quot;/&amp;gt;&lt;br /&gt;&amp;nbsp;&amp;nbsp; &amp;nbsp;&amp;lt;/system.serviceModel&amp;gt;&lt;br /&gt;&amp;lt;/configuration&amp;gt;&lt;/p&gt;&lt;p&gt;&lt;br /&gt;&lt;/p&gt;&lt;p&gt;Please help me where I am making mistake or suggest me if there are any setting I am missing any where&lt;br /&gt;&lt;/p&gt;&lt;p&gt;&lt;br /&gt;&lt;/p&gt;&lt;p&gt;&lt;br /&gt;&lt;/p&gt;</description></item><item><title>REST Client in 3.5 - Simple example required</title><link>http://forums.asp.net/thread/3250916.aspx</link><pubDate>Mon, 22 Jun 2009 15:02:47 GMT</pubDate><guid isPermaLink="false">4c671506-2930-414c-a40b-8bf57ded5924:3250916</guid><dc:creator>kashifmunir</dc:creator><author>kashifmunir</author><slash:comments>2</slash:comments><comments>http://forums.asp.net/thread/3250916.aspx</comments><wfw:commentRss>http://forums.asp.net/commentrss.aspx?SectionID=1180&amp;PostID=3250916</wfw:commentRss><description>&lt;p&gt;Hi All.&lt;/p&gt;
&lt;p&gt;I am new to ASP.NET 3.5. Havent really had the time to study WCF and its REST capabilities. In one of my projects, I have to communicate to a 3rd party REST based services. I do have the XML structure that I should pass to the REST service and some sample responses that I may receive from the REST based service but I do not know how to do it using .NET 3.5. Can anyone provide a simple example to atleast get me started. Will be really grateful if some code can also be provided in this regard.&lt;/p&gt;
&lt;p&gt;&amp;nbsp;&lt;/p&gt;</description></item><item><title>Error when setting "Host" HTTP Header</title><link>http://forums.asp.net/thread/3456026.aspx</link><pubDate>Tue, 13 Oct 2009 15:07:16 GMT</pubDate><guid isPermaLink="false">4c671506-2930-414c-a40b-8bf57ded5924:3456026</guid><dc:creator>johnsheehan</dc:creator><author>johnsheehan</author><slash:comments>3</slash:comments><comments>http://forums.asp.net/thread/3456026.aspx</comments><wfw:commentRss>http://forums.asp.net/commentrss.aspx?SectionID=1180&amp;PostID=3456026</wfw:commentRss><description>&lt;p&gt;Services like S3 heavily rely on the value of the &amp;quot;Host&amp;quot; http header, but when I set that value in DefaultHeaders I get an exception thrown when the request is executed (the exception text just says &amp;quot;Host&amp;quot;). Same with the Date header. Is there a supported way to set these headers that I&amp;#39;m missing?&lt;/p&gt;</description></item><item><title>REST "Connectedness" in WCF</title><link>http://forums.asp.net/thread/3459004.aspx</link><pubDate>Thu, 15 Oct 2009 02:42:32 GMT</pubDate><guid isPermaLink="false">4c671506-2930-414c-a40b-8bf57ded5924:3459004</guid><dc:creator>nathandw</dc:creator><author>nathandw</author><slash:comments>0</slash:comments><comments>http://forums.asp.net/thread/3459004.aspx</comments><wfw:commentRss>http://forums.asp.net/commentrss.aspx?SectionID=1180&amp;PostID=3459004</wfw:commentRss><description>&lt;p&gt;One of the key features of REST and Hypertext is &amp;quot;connectedness&amp;quot; or the idea of a resource containing links to related resources/states. For example a purchase order resource may have a link to the user who created it or a link to the order receipt. It may also have links that enable the state of the order to be changed, for example moving it from pending to outstanding. Are there any patterns for handling this kind of behavior (or any plans to define some)?&lt;/p&gt;&lt;p&gt;The first option I have considered is to decorate the DataContract classes (or property&amp;nbsp;accessors) with a custom attribute that informs REST that this class/resource can be found at the following URI Eg.&lt;/p&gt;&lt;p&gt;[Resource(&amp;quot;/account/users/user/{Id}&amp;quot;)]&lt;/p&gt;&lt;p&gt;public class User{}&lt;/p&gt;&lt;p&gt;public class Order&lt;/p&gt;&lt;p&gt;{&lt;/p&gt;&lt;p&gt;&amp;nbsp;&amp;nbsp; &amp;nbsp; [Resource(&amp;quot;/account/users/user/{Id}&amp;quot;)]&lt;/p&gt;&lt;p&gt;&amp;nbsp;&amp;nbsp; &amp;nbsp; public User User {get; set;}&lt;/p&gt;&lt;p&gt;}&lt;/p&gt;&lt;p&gt;When the Order is serialized the User property is treated as a link ( xhtml anchor, xml xlink, json string ) instead of a serialized version of the User. This starts to get complicated when you are dealing with scoped resources:&lt;/p&gt;&lt;p&gt;Resource(&amp;quot;/accounts/account/{accountId}/users/user/{userId}&lt;/p&gt;&lt;p&gt;This sort of thing could possibly be handled by infering the &amp;quot;accountId&amp;quot; from the request URL but not if the link is associated with a resource under another account. Another option is to do some sort of&amp;nbsp;hierarchal&amp;nbsp;referencing:&lt;/p&gt;&lt;p&gt;Resource(&amp;quot;/accounts/account/{Account.Id}/users/user/{Id}&amp;quot;)&lt;/p&gt;&lt;p&gt;Where the referenced User has an Id property and an Account property which contains an Id (User.Account.Id). This all seems to get pretty complicated quickly.&lt;/p&gt;&lt;p&gt;&lt;br /&gt;&lt;/p&gt;&lt;p&gt;The other option I have considered is to make my DataContracts RESTful, instead of&amp;nbsp;inferring&amp;nbsp;relationship URLs, build them right into the contract: Order.UserUri. But this kind of locks the DataContract into the REST pattern and prevents me from reusing it for SOAP or as a POCO for WF.&lt;/p&gt;&lt;p&gt;&lt;br /&gt;&lt;/p&gt;&lt;p&gt;Any guidance is greatly appreciated,&lt;/p&gt;&lt;p&gt;Thanks,&lt;/p&gt;&lt;p&gt;Nathan Winder&lt;/p&gt;</description></item><item><title>Lab 4, step 6: getting a 'Request Error'</title><link>http://forums.asp.net/thread/3397312.aspx</link><pubDate>Thu, 10 Sep 2009 09:44:00 GMT</pubDate><guid isPermaLink="false">4c671506-2930-414c-a40b-8bf57ded5924:3397312</guid><dc:creator>aips</dc:creator><author>aips</author><slash:comments>13</slash:comments><comments>http://forums.asp.net/thread/3397312.aspx</comments><wfw:commentRss>http://forums.asp.net/commentrss.aspx?SectionID=1180&amp;PostID=3397312</wfw:commentRss><description>&lt;p&gt;When I attempt to execute step 6 of the &amp;#39;Consuming RESTful Services&amp;#39; tutorial, I get the following error in the browser after right-clicking &amp;#39;Service.svc&amp;#39; and selecting &amp;#39;View in Browser&amp;#39;:&lt;/p&gt;&lt;p&gt;-----&lt;br /&gt;&lt;/p&gt;&lt;p&gt;&lt;b&gt;Error Status Code:&lt;/b&gt; &amp;#39;InternalServerError&amp;#39;&lt;/p&gt;
&lt;p&gt;&lt;b&gt;Details: &lt;/b&gt;The server encountered an error processing the request. Please see the server logs for more details.&lt;/p&gt;&lt;p&gt;-----&lt;br /&gt;&lt;/p&gt;&lt;p&gt;There is an &amp;#39;ASP.NET Development Server&amp;#39; icon in the system tray.&amp;nbsp; If I double-click it, I see the following:&lt;/p&gt;&lt;p&gt;Root URL: http://localhost:25000&lt;br /&gt;Port: 25000&lt;br /&gt;Virtual Path: /&lt;br /&gt;Physical Path: X:\Samples\WCF REST Hands On Labs Preview 2\Lab 4 - Consuming RESTFul Services\Working\CohoWinery\&lt;/p&gt;&lt;p&gt;Can anyone help me to solve this?&amp;nbsp; I was unable to figure out how to use httpcfg.exe, so I downloaded HttpConfig.exe instead.&amp;nbsp; On the permissions tab, I tried setting up the following URLs for registration and delegation, but I am having no luck at all.&lt;/p&gt;&lt;p&gt;http://+:25000/&lt;br /&gt;http://+:25001/&lt;br /&gt;http://+:25000/Service.svc/&lt;br /&gt;http://+:25001/Service.svc/&lt;/p&gt;&lt;p&gt;What am I doing wrong?&amp;nbsp; Is there something I should have set up in IIS?&lt;/p&gt;&lt;p&gt;Thanks&lt;br /&gt;Paul&lt;br /&gt;&lt;/p&gt;</description></item><item><title>Image Handling using REST starter kit</title><link>http://forums.asp.net/thread/3409459.aspx</link><pubDate>Wed, 16 Sep 2009 23:22:33 GMT</pubDate><guid isPermaLink="false">4c671506-2930-414c-a40b-8bf57ded5924:3409459</guid><dc:creator>snehitn</dc:creator><author>snehitn</author><slash:comments>10</slash:comments><comments>http://forums.asp.net/thread/3409459.aspx</comments><wfw:commentRss>http://forums.asp.net/commentrss.aspx?SectionID=1180&amp;PostID=3409459</wfw:commentRss><description>&lt;p&gt;I am trying to develop a REST Service using the kit to send and receive images. From wat i have researched and understood ,it seems i can only do so using stream of bytes.&amp;nbsp;&lt;/p&gt;&lt;p&gt;Am i right? if so can anyone explain or list a simple sample for me which clearly show the usage.&lt;/p&gt;&lt;p&gt;If i am not. wat is the best way to handle images... is it as a stream or as a xml serializable or as json ?..I am quite confused . Any help would be really appreciated.&lt;/p&gt;&lt;p&gt;&lt;br /&gt;&lt;/p&gt;</description></item></channel></rss>