I am trying to make a WCF service that will work with JSON-P (the long story is shorter, we need to call the cross-domain web service and get a callback, so I need it to work with JSON-P).
I found the sample code on MSDN ( http://msdn.microsoft.com/en-us/library/cc716898.aspx ). If I extract the ZIP file and go to Samples \ WCFWFCardSpace \ WCF \ Extensibility \ Ajax \ JSONP \ CS, I get a project in which certain bindings and extensions were created, which will give WCF the ability to splash out a JS call after it returns JSON.
Unfortunately, when I try to copy this code and implement it in my project, it does not work.
I get the following error:
Could not find configuration binding extension 'system.serviceModel / bindings / jsonpBinding'. Make sure that this binding extension is correctly registered in the system.serviceModel / extensions / bindingExtensions file and that it is spelled correctly.
It is as if the developers at Microsoft have left aside some vital parts of the code that are needed for this, and I'm not sure what they left or what it means.
Has anyone had experience using WCF with JSON-P?
If there is a way to get this sample project to work, Iβm all ear.
If there is an alternative way to do cross-domain web service requests from Javascript to WCF, I'm also interested.
source
share