WCF and the WebHttpBinding

One new binding with Orcas Beta 2 and WCF I’m really excited about is the new WebHttpBinding – got to love the Json all built in 🙂 Plus the new WebGet attribute to get your REST services on the way. One thing I thought was missing was the ability to be able to specify a callback method when you call a service and want some Json back (I couldn’t find an option/see anything in Reflector but maybe there is a way to get it in there?). The point being that if a browser does an HTTP GET using a script tag then it may want to put the Json it gets back through a callback function or assign it to some variable – not just dump the Json into the page 🙂

So to get this built in I made an http module which you can get from here. When you call the service and attach a query string parameter of callback=your_javascript_function_name_here it will wrap the Json getting spat out in the function specified 🙂

Advertisements

2 Responses to “WCF and the WebHttpBinding”

  1. Boris Says:

    Hi! I was wondering the same thing regarding the callback function! Would you mind e-mailing me some code with a complete example? Please excuse me for being such a newbie to WCF)

    I would greatly appreciate it!!

  2. Carlos de Luna Sáenz Says:

    I am having headaches with this, i wonder if you can solve me some doubts, since i already have my services but, until now i have been unable to make a conection to them.
    Greetings

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


%d bloggers like this: