Programming the Web using WCF 3.5 – ‘Web HTTP Programming Model’


Publishing RSS and ATOM Feeds using WCF 3.5 Syndication Libraries:

Windows Communication Foundation with its 3.5 release provides several new and useful features including capability to publish and consume syndication feeds in a much easier and uniform way, right out of the box. This article focuses on using the WCF 3.5 libraries namely System.ServiceModel.Syndication namespace to create and publish an RSS and Atom feed from the same code base. System.ServiceModel.Syndication provides a framework to perform the syndication leg-work for us including serialization and deserialization of web feeds.

image

HTTP Programming with WCF and the .NET Framework 3.5:

WCF in the .NET Framework 3.5 includes an easy-to-use HTTP programming model, JavaScript Object Notation (JSON) messaging capabilities, and a new syndication API that makes it easy to create and consume syndicated content. With this feature set, WCF is now the service platform of choice for connecting services to Web clients, whether they are ASP.NET AJAX controls, SilverlightTMclients, or even browsers. These features also work in partial trust scenarios (like ASP.NET medium trust) so you can host WCF services in widely available hosting environments. To round it all out, there’s also new tooling integrated into Visual Studio®2008 that dramatically reduces the amount of time it takes to get a service up and running.

This means you can build a service that communicates within or across enterprise boundaries using SOAP and WS-*, and you can configure that same service to communicate externally using the protocols of the Web – JSON, RSS & ATOM. 

It starts with a level-setting discussion about some of the important architectural principles in HTTP and the Web, then moves to the new HTTP programming model in WCF, and, finally, to the new syndication API.

  • HTTP message basics
  • Adding information to URIs
  • WCF and HTTP
  • RSS and ATOM with WCF
  •  image

    image

    Use LINQ and .NET 3.5 to Convert RSS to JSON using DataContractJsonSerializer and HttpHandler

    JavaScriptSerializer is marked as obsolete with a note to use the DataContractJsonSerializer instead.  Here is what a generic HTTP Handler would look like that mashes up these techniques using .NET 3.5.

    image

    Creating a JSON Service with WCF 3.5, DataContractJsonSerializer and WebGetAttribute

    image

    image

    Create RSS and Atom Feeds with LINQ and WCF Syndication in .NET 3.5 within ASPX

    image

    …..

    image

    Also directly from MSDN – WCF 3.5 Feature List

    image

    Web Programming Model
    http://msdn2.microsoft.com/en-us/library/bb412169.aspx

    Web Programming Model Samples
    http://msdn2.microsoft.com/en-us/library/bb472415.aspx

    WCF Syndication
    http://msdn2.microsoft.com/en-us/library/bb412202.aspx

    Syndication Samples
    http://msdn2.microsoft.com/en-us/library/bb943474.aspx

    Advertisements

    Leave a Reply

    Fill in your details below or click an icon to log in:

    WordPress.com Logo

    You are commenting using your WordPress.com account. Log Out / Change )

    Twitter picture

    You are commenting using your Twitter account. Log Out / Change )

    Facebook photo

    You are commenting using your Facebook account. Log Out / Change )

    Google+ photo

    You are commenting using your Google+ account. Log Out / Change )

    Connecting to %s