Demystifying The Code

Effective Error Handling with WCF & REST

I recently received a question regarding effective error handling when working with RESTful web services.  In this post, I will illustrate how to expose, as well as handle errors effectively when working with RESTful WFC services. 

 

[ Read More → ]

Exposing ATOM feeds from your services – part II – customizing and extending the ATOM feed

In yesterday’s post, I illustrated using the WCF REST Starter kit to create a RESTful service that exposes a sample ATOM feed.  We accomplished this by simply creating a new service using the ‘WCF ATOM Feed Service’ item template.  This template created an svc file with a REST-friendly factory.  It also created a cs file with one operation that returned an Atom10FeedFormatter.  The feed contained dummy syndication items.  In this post, I will show you how to update this code to expose custom data.  In this case, we will expose a feed of wines from a wine catalog.

[ Read More → ]

Exposing ATOM feeds from your services

One of the key enabling factors of the browsable web was the use of a standard representation format: HTML.  Web page authors need only understand one format and browsers need only understand how to render one format.  In other words, if I authored a web page in HTML, it was easily consumable because every browser understood our standard representation format.  This same concept can and does hold true for our RESTful services.  If my service returns a standard representation format like ATOM, there are already a host of clients that can consume the response.  Conversely, if my service returns POX (plain old XML), we are starting at ground zero.

The key to choosing a representation format is to choose one that is standardized, fits your problem domain and is widely understood in that domain.  The ATOM Syndication Format is a standardized XML-Based format for web feeds. 

[ Read More → ]

Demystifying The Code