Using WebHttpBinding & JSON Support in WCF


 

I had some cool time working with WCF new features shipped with .net 3.5, one of the most ineteresting and useful features is the JSON support and how easy you can enable the JSON support for your current WCF services by changing the configurations.

Why do we need JSON support?

Well, JSON (JavaScript Object Notation) is very suitable for building ajax based applications for some reasons.

  1. The other popular alternative (XML) requires parsing code in the client side to extract the data from the document, which is not the best thing to do using Javascript.
  2. XML documents size are relatively bigger than JSON documents containing the same data

To get more info about JSON check here and here

What WCF offers to support JSON

All what you need is doing two things

  1. Create an end point that uses the new binding (WebHttpBinding)
  2. Configure the end point behavior and enabling the WebScript (which will generate a javascript proxy for your service contract and data contracts)

And More…

Via Using WebHttpBinding & JSON Support in WCF

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