about WCF Service in SharePoint

Category: sharepoint 2013 development and programming


Will .H on Sun, 20 Oct 2019 14:10:10

Hi there,


I created a WCF Service in the SharePoint. And I have a Class Library will involve the WCF service from my client's machine.


I added Service Reference of the service http://win-6clkd4aeaol:8096/_layouts/15/SPWCFService/SPService.svc and login. I got the error message "An error occurred while attempting to find services at 'http://win-6clkd4aeaol:8096/_layouts/15/SPWCFService/SPService.svc'. The remote server returned an error: (404) Not Found. ". I have a try to test my WCF Service on my SharePoint Lab and connect to http://win-6clkd4aeaol:8096/_layouts/15/SPWCFService/SPService.svc/GetData?F=5. it works properly.


I have no idea on it. why I cannot add WCF Service from my SharePoint Server.??

Thanks for ur help.

Hi there, if you found my comment very helpful then please | Propose as answer | . Thanks and Regards.


Lee__li on Mon, 21 Oct 2019 01:52:47


Could you access the WCF hosted server?

You should be able to access the wcf from browser /_layouts/15/SPWCFService/SPService.svc

Attach two threads for your reference.



Best Regards,


Justin Liu_FoxDave on Mon, 21 Oct 2019 02:41:17


Where do you add the service reference? Make sure the service can be called there.

Will .H on Mon, 21 Oct 2019 02:43:45

Hi Lee,

You should be able to access the wcf from browser /_layouts/15/SPWCFService/SPService.svc -> I can access this from local or remote by Explorer and  get the correct value.

I will have a look the above article you gave me. Thanks


Will .H on Mon, 21 Oct 2019 02:44:48

Hi Justin,

Call it from C# Class Library from my client's lab machine - windows 10. Sure, from here we could call it by Explorer.

Will .H on Mon, 21 Oct 2019 10:10:04

Hi Lee,

I followed the above article and got the error message as the following:

Sorry, something went wrong

The service cannot be activated because it does not support ASP.NET compatibility. ASP.NET compatibility is enabled for this application. Turn off ASP.NET compatibility mode in the web.config or add the AspNetCompatibilityRequirements attribute to the service type with RequirementsMode setting as 'Allowed' or 'Required'.

Correlation ID: 6aff0f9f-c4a8-404b-d55a-cae46a21da64

Date and Time: 10/21/2019 3:08:10 AM

Will .H on Mon, 21 Oct 2019 13:29:59

Hi Lee,

 I add a line configuration like the following: and it works fine.

[AspNetCompatibilityRequirements(RequirementsMode = AspNetCompatibilityRequirementsMode.Allowed)]
public class Service : IService