WCF the REST way

Today I attended a session on using WCF through the REST model of web service interactions. This remote method model is based on HTTP requests and includes the following HTTP actions: GET, POST, PUT, and DELETE. This model relies more heavily on the role of URIs as a way to more clearly define resource endpoints. Jon Flanders talked about techniques in defining well-known URLs based on the general experience most people have with the web and URLs. Resources in the REST model are useful because they more clearly identify entities within a business object model. So rather than have a service method called GetWidgets you would have a Widgets resource and send in a GET action to get the Widgets.
 
Recently, I have been reading through the book Learning WCF (by that Indigo girl) and it spends some time explaining the role of endpoint base addresses and full addresses. Base addresses are based on a configuration entry for the address and then a Service URI that indicates the service at which the base address then exists. Here is a link about the use of Base Address: http://www.dasblonde.net/CommentView,guid,756f2aee-7146-4bc3-8406-d0e3530dc507.aspx (the CSS styling is not working right on her site so select the text on the article to see the text.) I did not hear much in the REST session about the role of base addresses and full addresses, but it seems like this would be a more natural approach than building an extra long url like a Flickr url (http://www.flickr.com/photos/mzalikowski/530036109/) where the date is a meaningful URI and one of a couple different resource addresses possible with Flickr.
 
I think the REST model will serve to simplify the addressing schemes used with web services but I am a little worried about interoperability. For example, if a SOAP service exposes a web service endpoint that provides WSDL, it would also make sense to expose an endpoint that provides REST since it is a different invocation standard. WSDL has very widespread adoption, whereas REST is not implemented by everyone and could take a while before all vendors provide a compatible implementation. I am worried about web service integration that does not recognize PUT or DELETE operations and the possibility that these may be handled inproperly if a SOAP engine or HTTP engine processes these incorrectly. More to follow on whether I find any incompatibilities or gotchas with REST…
 
Tune in tomorrow for a post on the last day of TechEd. Thanks to anyone who has been reading my posts.

Blog at WordPress.com.

Up ↑