In Thursday’s post (Part VII), I illustrated how to implement insert/update functionality in a HI-REST service operation. In this post, I will illustrate implementing a delete. Unlike the previous post, there is little debate how to implement a RESTful delete. Further, the lessons we learned in the previous few posts will make implementing the delete trivial. I’m going to start motoring through…[ Read More → ]
In parts I – VI, I illustrated exposing fetch functionality in a LO-REST, AJAX-Friendly manner, as well as in a HI-REST manner. I further illustrated how to consume both via an AJAX client. In this post I am going to discuss and illustrate how to implement insert and update functionality in a HI-REST manner. If you remember back to the point I made in Part I of this series, I suggested that there are many definitions of REST and put forth the idea of a REST continuum. This is a healthy manner to discuss REST, in that it allows for many interpretations. If I have learned anything over my years of coding is that there are always many ways to solve a business problem with code. Not only are there many ways, but there are many correct ways.[ Read More → ]
In Part V of this blog series I completed the service operation exposed via HTTP GET in a HI-REST manner. Because the service was exposed via GET and had a representation format of POX, we were able to easily test it using our browser. That is all well and good for testing purposes, but we are going to need to call our service from a real client, at some point. We have a variety of choices when deciding upon our clients… We could write an ASP.NET client, an AJAX client, a Silverlight client, a smart client, an office client, etc. For the purposes of this blog post, I will illustrate how you can call this service from an AJAX client. By the time I am done with this post, you will have a newfound respect for the client proxy generation functionality exposed by the enableWebScript endpoint behavior (described in Part III of this series).[ Read More → ]
REST in WCF – Part V (HI-REST – Exposing a service via GET – The ServiceContract and Implementation)
In yesterdays post (Part IV of the series), I began the process of developing a HI-REST GET service operation. I noted that there is not a template (yet – it is coming in the REST toolkit due out later this year) for HI-REST services. So, I decided to start by using the plain vanilla ‘WCF Service’ Visual Studio template. This template defaults to a HTTP SOAP binding that supports advanced web service standards. I next illustrated what we need to do to convert this configuration to support a HI-REST service. Essentially it boiled down to 3 things: 1. Set the binding in your endpoint to webHttpBinding, 2. Add a behavior under the endpointBehaviors element that has a webHttp child element and 3. Add a behaviorconfiguration to your endpoint that references the endpoint behavior added in step 2.
In this post, we will complete the development of this HI_REST GET service operation.[ Read More → ]
In part I of this series, I gave a brief overview of REST and put forth the concept of the REST continuum. I made the case that differing folks had differing views on what REST is and that is ok. I put forth the case that these differing definitions of REST made up a continuum of sorts, with one end being LO-REST and the other HI-REST. In parts II and III, I introduced the webHttpBinding, a new binding to WCF 3.5 (part of Fx 3.5 that installs with VS 2008). I discussed that this is the binding that now allows us to expose services RESTfully. I noted that when working with this binding, your endpoint must have a behaviorConfiguration that ties it to one of two endpoint behaviors: enableWebScript and webHttp. I pointed out that the enableWebScript endpoint behavior was an AJAX-Friendly implementation of the webHttp endpoint behavior (it is actually a subclass). Lastly, I build a sample utilizing the AJAX-Friendly endpoint behavior (enableWebScript) and postulated that this type of implementation was RESTful and fell along the LO side of the continuum.
In this post and the following few, I will introduce the features of the webHttp endpoint behavior. I will illustrate how you can take advantage of these features to implement services that fall on the HI-REST end of the continuum. Specifically, in today’s post, I will illustrate the GET functionality.[ Read More → ]