How to consume Cross-Domain WCF service from Matrix

Hi,


How do I call Cross Domain WCF service from Matrix? can we still be able to use the REST Resource Asset? or just using jQuery to call and process WCF service?

can anyone help to provide examples or links?



Thanks!

By jQuery I'm guessing your talking about AJAX? If so, AJAX is restricted to the Single Origin Policy: http://en.wikipedia.org/wiki/Same_origin_policy.


There is a proposal within W3C for Cross Origin Resource Sharing (http://www.w3.org/TR/cors/) however I haven't actually used it myself just yet, and it is restricted to certain browsers.



If I was you, I would look into one of two options (depending on what you're trying to do):



[list=1]

  • Using JSONP
    [*]Using a "proxy" (aka REST Resource JavaScript asset)


    For a good practical demo of JSONP, check out this StackOverflow response: http://stackoverflow.com/questions/395045/cross-site-xmlhttprequest

    You can also read more about these restrictions on this page: https://developer.mozilla.org/En/HTTP_Access_Control