Archive for June 2011
Custom WCF Service in SharePoint returning HTTP 400 Bad Request
I followed the MSDN article Creating a Custom WCF Service in SharePoint Foundation to deploy my own custom WCF service into the ISAPI folder of SharePoint 2010. I was under the impression that browsing to the url where my .svc file was located would return some kind of WSDL. I was also expecting that I could use this url to add a Service Reference in Visual Studio 2010. Instead, I was getting a HTTP 400 Bad Request responses in both scenarios, making me think there was something wrong with the implementation of my service.
In fact, as it turns out, there was nothing wrong with my service implementation – all I had to do was simply append /mex to the service url i.e. http://sharepoint/_vti_bin/MyService.svc/mex
Hope this helps!