JSONP support (callbacks)

Jul 7, 2011 at 5:08 PM

Is there an example of how to add JSONP support for callbacks e.g. callbackParam ?

Please advise.

Jul 30, 2011 at 5:00 AM

JSONP support is essential for me too.

Dave.

Aug 7, 2011 at 5:18 PM

I've used RestCake with jsonp.  It's an implementation detail for the client only.  There was nothing extra to do in the service, just add ?jsonCallback=? to the end of the UrlTemplate you configured for the RestCake call.

So, a normal call might look like: http://someServer.com/ServiceImpl/RestCakeCall

a jsonp call will look like: http://someServer.com/ServiceImpl/RestCakeCall?jsonCallback=?

the RestCake config looks like:

[OperationContract]       

[WebGet(ResponseFormat = WebMessageFormat.Json, UriTemplate = "RestCakeCall")]       

public object someJsonpCall()        {

}

 

 

HTH.