none
what are REST services on WCF?

    Question

  • what are REST services on WCF? Is it something accessed thru https? what are the changes we need to do to implement the RESTful service in our project.
    Thanks!! MCP
    Wednesday, May 19, 2010 8:51 AM

All replies

  • Hi, maybe this will help you out. It is an introduction to REST and WCF Services.

    http://msdn.microsoft.com/en-us/magazine/dd315413.aspx

    Wednesday, May 19, 2010 12:42 PM
  • Thanks for the reply but still not very clear, Can anyone tell me in layman language , why do I need REST service why not normal web service?
    Thanks!! MCP
    Thursday, May 20, 2010 8:39 AM
  • Hi,

     WCF REST, actually provides Plain-Old-Xml (POX), result when the WCF service is browsed. In correct word it can be explained that, as like in web services, it was possible to invoke WebMethod in browser by passing parameters to it, same thing we can do in WCF REST. WCF has FREST support form .NET 3.5 SP1.

    Following are the cahnges we nedd to do:  

    Add refernece for System.ServiceModel.Web, in service application.

    Use [WebGet] attribute on Operation in service conmtract

    e.g.

    [OperationContract]

    [WebGet]

    string GetData(string val) 

    WCF REST has support for Http verbs like GET,POST,PUT and DELETE

    Http GET can be performed using [WebGet] and POST,PUT and DELETE can be using [WebInvoke] operation.

    The binding ypu can use for WCF REST is webHttpBinding. And to activate it on IIS you need to use additional value in Service.svc file

    Factory="System.ServiceModel.Activation.WebServiceHostFactory"

    For the further I have posted article on WCF REST and its consumption in varipous clients:

     

    http://www.dotnetcurry.com/ShowArticle.aspx?ID=387 -> Consuming in WPF 3.5

    http://www.dotnetcurry.com/ShowArticle.aspx?ID=434 -> REST with Windows Authentication.

    http://www.dotnetcurry.com/ShowArticle.aspx?ID=472 -> Consuming in Windows Mobile 6.

    http://www.dotnetcurry.com/ShowArticle.aspx?ID=469 -> Consuming in Silverlight 3.0.

    http://www.dotnetcurry.com/ShowArticle.aspx?ID=501 -> WIndows Phone 7.

    All these articles will definately help you.

     

    REgards

     

    MAhesh Sabnis

     

     

     

     

     

     

    Friday, May 21, 2010 11:15 AM
  • Hi,

    Actually I live in basic .Net world and these JASON, WPF, Silverlight are out of my scope currently. Though I know WCF some so when we create a REST service by this I mean we can access the service using the url (eg: http://www.xyz.com/GetProductInfo/HP) that means for consuming the REST service we don't have to create a proxy class and call the service method thru the proxy object and then pass the parameters. Please correct me if I am wrong. Because after looking into some example to REST service consumer as JSON,WPF I very much confused.

    Moreover, generally bolgs have REST similar URL, I guess, like http://sample.wordpress.com/2010/05/24/linq/, please again correct me if I am wrong??


    Thanks!! http://gurunguns.wordpress.com
    • Edited by GurunGuns Thursday, June 03, 2010 10:50 AM update
    Thursday, June 03, 2010 10:46 AM