<?xml version="1.0" encoding="UTF-8" ?>
<?xml-stylesheet type="text/xsl" href="http://blogs.msdn.com/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>REST in WCF - Part V (HI-REST - Exposing a service via GET - The ServiceContract and Implementation)</title><link>http://blogs.msdn.com/bags/archive/2008/06/10/rest-in-wcf-part-v-hi-rest-exposing-a-service-via-get-the-servicecontract-and-implementation.aspx</link><description>The post on building a HI-REST GET with WCF has been moved to my new blog at www.robbagby.com .</description><dc:language>en</dc:language><generator>CommunityServer 2.1 SP1 (Build: 61025.2)</generator><item><title>re: REST in WCF - Part V (HI-REST - Exposing a service via GET - The ServiceContract and Implementation)</title><link>http://blogs.msdn.com/bags/archive/2008/06/10/rest-in-wcf-part-v-hi-rest-exposing-a-service-via-get-the-servicecontract-and-implementation.aspx#8625836</link><pubDate>Fri, 20 Jun 2008 19:55:50 GMT</pubDate><guid isPermaLink="false">91d46819-8472-40ad-a661-2c78acb4018c:8625836</guid><dc:creator>wormster</dc:creator><description>&lt;P&gt;Hi Rob&lt;/P&gt;
&lt;P&gt;I am trying to implement an interface for the service contract:-&lt;/P&gt;
&lt;P&gt;namespace Medquist&lt;/P&gt;
&lt;P&gt;{&lt;/P&gt;
&lt;P&gt;&amp;nbsp; &amp;nbsp;[ServiceContract(Namespace = "WCFServices")]&lt;/P&gt;
&lt;P&gt;&amp;nbsp; &amp;nbsp;public interface IXDomainService&lt;/P&gt;
&lt;P&gt;&amp;nbsp; &amp;nbsp;{&lt;/P&gt;
&lt;P&gt;&amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp;[OperationContract]&lt;/P&gt;
&lt;P&gt;&amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp;[WebGet(ResponseFormat = WebMessageFormat.Json)]&lt;/P&gt;
&lt;P&gt;&amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp;Medquist.PatientData SearchPAS(string userSessionId, string patientID, string patientDoB);&lt;/P&gt;
&lt;P&gt;&amp;nbsp; &amp;nbsp;}&lt;/P&gt;
&lt;P&gt;}&lt;/P&gt;
&lt;P&gt;and the service...&lt;/P&gt;
&lt;P&gt;namespace Medquist&lt;/P&gt;
&lt;P&gt;{&lt;/P&gt;
&lt;P&gt;&amp;nbsp; &amp;nbsp;public class XDomainService : IXDomainService&lt;/P&gt;
&lt;P&gt;&amp;nbsp; &amp;nbsp;{&lt;/P&gt;
&lt;P&gt;&amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp;public PatientData SearchPAS(string userSessionId, string patientID, string patientDoB)&lt;/P&gt;
&lt;P&gt;&amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp;{&lt;/P&gt;
&lt;P&gt;........&lt;/P&gt;
&lt;P&gt;config file :-&lt;/P&gt;
&lt;P&gt;&amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp;&amp;lt;services&amp;gt;&lt;/P&gt;
&lt;P&gt;&amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp;&amp;lt;service name="XDomainService"&amp;gt;&lt;/P&gt;
&lt;P&gt;&amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp;&amp;lt;endpoint address="" behaviorConfiguration="XDomainServiceAspNetAjaxBehavior"&lt;/P&gt;
&lt;P&gt;&amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; binding="webHttpBinding" contract="IXDomainService" /&amp;gt;&lt;/P&gt;
&lt;P&gt;&amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp;&amp;lt;/service&amp;gt;&lt;/P&gt;
&lt;P&gt;&amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp;&amp;lt;/services&amp;gt;&lt;/P&gt;
&lt;P&gt;However the proxy in the AJAX javascipt cannot resolve the namespace&lt;/P&gt;
&lt;P&gt;var proxy = new WCFServices.XDomainService();&lt;/P&gt;
&lt;P&gt;&amp;nbsp; &amp;nbsp;proxy.SearchPAS(......&lt;/P&gt;
&lt;P&gt;I have specified Factory="System.ServiceModel.Activation.WebScriptServiceHostFactory" in the .svc file. Am I missing something else? Without the interface and all the attributes in place, everything works fine.&lt;/P&gt;
&lt;P&gt;John&lt;/P&gt;</description></item><item><title>re: REST in WCF - Part V (HI-REST - Exposing a service via GET - The ServiceContract and Implementation)</title><link>http://blogs.msdn.com/bags/archive/2008/06/10/rest-in-wcf-part-v-hi-rest-exposing-a-service-via-get-the-servicecontract-and-implementation.aspx#8658640</link><pubDate>Fri, 27 Jun 2008 01:33:37 GMT</pubDate><guid isPermaLink="false">91d46819-8472-40ad-a661-2c78acb4018c:8658640</guid><dc:creator>rob.bagby</dc:creator><description>&lt;p&gt;John,&lt;/p&gt;
&lt;p&gt;If you set the WebScriptServiceHostFactory in the svc, your configurations will be ignored (or an exception will be thrown). &amp;nbsp;It automatically configures the webHttpBinding with the enableWebScript endpoint behavior. &amp;nbsp;If you omit this, you would need to add an endpoint behavior configured in the web.config. &amp;nbsp;Something like this:&lt;/p&gt;
&lt;p&gt;&amp;lt;system.serviceModel&amp;gt;&lt;/p&gt;
&lt;p&gt; &amp;nbsp; &amp;nbsp;&amp;lt;behaviors&amp;gt;&lt;/p&gt;
&lt;p&gt; &amp;nbsp; &amp;nbsp; &amp;nbsp;&amp;lt;endpointBehaviors&amp;gt;&lt;/p&gt;
&lt;p&gt; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp;&amp;lt;behavior name=&amp;quot;XDomainServiceAspNetAjaxBehavior&amp;quot;&amp;gt;&lt;/p&gt;
&lt;p&gt; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp;&amp;lt;enableWebScript /&amp;gt;&lt;/p&gt;
&lt;p&gt; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp;&amp;lt;/behavior&amp;gt;&lt;/p&gt;
&lt;p&gt; &amp;nbsp; &amp;nbsp; &amp;nbsp;&amp;lt;/endpointBehaviors&amp;gt;&lt;/p&gt;
&lt;p&gt; &amp;nbsp; &amp;nbsp;&amp;lt;/behaviors&amp;gt;&lt;/p&gt;
&lt;p&gt;...&lt;/p&gt;
&lt;p&gt;In either case, you also need to have a ScriptManager in your page with a service path configured:&lt;/p&gt;
&lt;p&gt; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp;&amp;lt;asp:ScriptManager ID=&amp;quot;scriptManager&amp;quot; runat=&amp;quot;server&amp;quot;&amp;gt;&lt;/p&gt;
&lt;p&gt; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;lt;Services&amp;gt;&lt;/p&gt;
&lt;p&gt; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp;&amp;lt;asp:ServiceReference Path=&amp;quot;~/YourPathToYourSvc.svc&amp;quot; /&amp;gt;&lt;/p&gt;
&lt;p&gt; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp;&amp;lt;/Services&amp;gt;&lt;/p&gt;
&lt;p&gt; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp;&amp;lt;/asp:ScriptManager&amp;gt;&lt;/p&gt;
&lt;p&gt;The best way to check to make sure you have everything is to rt-click the page and View Source. &amp;nbsp;Look for the &amp;lt;script element that has &amp;quot;YourSvcFile.svc/js&amp;quot; or &amp;quot;YourSvcFile.svc/jsdebug&amp;quot;. &amp;nbsp;Copy that relative path to the address bar of the browser (if your svc file and page are at the root, simply replace the YourPage.aspx with YourService.svc. &amp;nbsp;If you are prompted with a dialog to save the proxy file (it is javascript), you are in business. &amp;nbsp;if not, Houston, there is a problem.&lt;/p&gt;
</description></item><item><title>re: REST in WCF - Part V (HI-REST - Exposing a service via GET - The ServiceContract and Implementation)</title><link>http://blogs.msdn.com/bags/archive/2008/06/10/rest-in-wcf-part-v-hi-rest-exposing-a-service-via-get-the-servicecontract-and-implementation.aspx#8684606</link><pubDate>Thu, 03 Jul 2008 19:19:17 GMT</pubDate><guid isPermaLink="false">91d46819-8472-40ad-a661-2c78acb4018c:8684606</guid><dc:creator>wormster</dc:creator><description>&lt;p&gt;Thanks, Rob.&lt;/p&gt;
&lt;p&gt;The service file js indicated that the proxy was using the Interface, IXDomainService in the name space &amp;nbsp;- I didn't realise that. Changing the proxy to...&lt;/p&gt;
&lt;p&gt;var proxy = new WCFServices.IXDomainService();&lt;/p&gt;
&lt;p&gt;...resolved the issue.&lt;/p&gt;
&lt;p&gt;Thanks again&lt;/p&gt;
&lt;p&gt;John&lt;/p&gt;
</description></item><item><title>REST in WCF Blog Series Index</title><link>http://blogs.msdn.com/bags/archive/2008/06/10/rest-in-wcf-part-v-hi-rest-exposing-a-service-via-get-the-servicecontract-and-implementation.aspx#8841425</link><pubDate>Thu, 07 Aug 2008 21:03:29 GMT</pubDate><guid isPermaLink="false">91d46819-8472-40ad-a661-2c78acb4018c:8841425</guid><dc:creator>Demystifying The Code</dc:creator><description>&lt;p&gt;As some of you know, I am in the midst of a blog series on REST in WCF. Further, I have been hard at&lt;/p&gt;
</description></item><item><title>REST in WCF - Part VI (HI-REST - Consuming our GET service via AJAX)</title><link>http://blogs.msdn.com/bags/archive/2008/06/10/rest-in-wcf-part-v-hi-rest-exposing-a-service-via-get-the-servicecontract-and-implementation.aspx#8843898</link><pubDate>Fri, 08 Aug 2008 20:42:43 GMT</pubDate><guid isPermaLink="false">91d46819-8472-40ad-a661-2c78acb4018c:8843898</guid><dc:creator>Demystifying The Code</dc:creator><description>&lt;p&gt;In Part V of this blog series I completed the service operation exposed via HTTP GET in a HI-REST manner.&lt;/p&gt;
</description></item><item><title>REST in WCF - Part XI (Tunneling PUT through POST)</title><link>http://blogs.msdn.com/bags/archive/2008/06/10/rest-in-wcf-part-v-hi-rest-exposing-a-service-via-get-the-servicecontract-and-implementation.aspx#9058812</link><pubDate>Tue, 11 Nov 2008 01:25:36 GMT</pubDate><guid isPermaLink="false">91d46819-8472-40ad-a661-2c78acb4018c:9058812</guid><dc:creator>Demystifying The Code</dc:creator><description>&lt;p&gt;A common scenario you may encounter when designing your RESTful services is supporting clients that only&lt;/p&gt;
</description></item><item><title>REST in WCF </title><link>http://blogs.msdn.com/bags/archive/2008/06/10/rest-in-wcf-part-v-hi-rest-exposing-a-service-via-get-the-servicecontract-and-implementation.aspx#9251494</link><pubDate>Wed, 24 Dec 2008 09:34:39 GMT</pubDate><guid isPermaLink="false">91d46819-8472-40ad-a661-2c78acb4018c:9251494</guid><dc:creator>Journal of Abu Sayed Mohammad Ismail</dc:creator><description>&lt;p&gt;The series blog post on REST in WCF REST in WCF - Part I (REST Overview) REST in WCF - Part II (AJAX&lt;/p&gt;
</description></item><item><title>Exposing ATOM feeds from your services</title><link>http://blogs.msdn.com/bags/archive/2008/06/10/rest-in-wcf-part-v-hi-rest-exposing-a-service-via-get-the-servicecontract-and-implementation.aspx#9413681</link><pubDate>Thu, 12 Feb 2009 02:25:15 GMT</pubDate><guid isPermaLink="false">91d46819-8472-40ad-a661-2c78acb4018c:9413681</guid><dc:creator>Demystifying The Code</dc:creator><description>&lt;p&gt;One of the key enabling factors of the browsable web was the use of a standard representation format:&lt;/p&gt;
</description></item><item><title>re: REST in WCF - Part V (HI-REST - Exposing a service via GET - The ServiceContract and Implementation)</title><link>http://blogs.msdn.com/bags/archive/2008/06/10/rest-in-wcf-part-v-hi-rest-exposing-a-service-via-get-the-servicecontract-and-implementation.aspx#9809429</link><pubDate>Tue, 30 Jun 2009 11:59:54 GMT</pubDate><guid isPermaLink="false">91d46819-8472-40ad-a661-2c78acb4018c:9809429</guid><dc:creator>Ulhas</dc:creator><description>&lt;p&gt;It's a very nice explained article about REST-WCF integration. &lt;/p&gt;
&lt;p&gt;Thanks a lot Rob, it helped me out.&lt;/p&gt;
</description></item></channel></rss>