I've created a custom WCF service in SharePoint 2010 which I am trying to call via a JQuery Ajax request. My custom WCF service is modeled on the example given here:
Link: http://blog.sharepointbits.com/2010/04/custom-wcf-services-in-sharepoint-2010_17.html
The above method gave me a WCF service I could access from C# server-side code, and a custom InfoPath form, however, I was unable to get a response using JQuery Ajax.
I read elsewhere on Stack Overflow to use MultipleBaseAddressWebServiceHostFactory
instead of a MultipleBaseAddressBasicHttpBindingServiceHostFactory
as the original article suggest.
Link: Sharepoint 2010 wcf service. call method with jquery
This worked, allowing me to contact (but not authenticate to) the service via JQuery Ajax, however,
a) I am no longer able to navigate to http://[servername]/_vti_bin/Service.svc/mex and see a WSDL. This problem means my InfoPath forms cannot connect to the service either, because they look for a WSDL.
b) Even though the JQuery Ajax request hits the custom WCF service, the browser asks me for authentication every single time, even though the request comes from the browser of a user logged into SharePoint.
If anyone knows how to fix issues a) and b) I'd be very appreciative. It really shouldn't be so difficult to make a service that can be used from any application.