Search code examples
c#c#-4.0wcf-web-api

C# WCF Web API + JSONP


Is there an easy way to get JSONP working for the new WCF Web API rest services?

I've tried this with no luck

<standardEndpoints>
  <webHttpEndpoint>
    <standardEndpoint name=""
                      helpEnabled="true"
                      automaticFormatSelectionEnabled="true"
                      defaultOutgoingResponseFormat ="Json"
                      crossDomainScriptAccessEnabled="true"/>
  </webHttpEndpoint>
</standardEndpoints>

Solution

  • https://alexanderzeitler.com/articles/Look-Ma,-I-can-handle-JSONP-%28aka-Cross-Domain-JSON%29-with-WCF-Web-API-and-jQuery!/

    Update: Latest WCF Web API bits ships with integrated JSONP support whereas usage is almost similar to the way described in the link above.