SharePoint 2013 is developers provide a rich rest API that facilitates our data in the Client action list. Of course, we can also create a custom rest service in SharePoint 2013, such as working with the database through the rest service. This blog post describes how to create a WCF REST Service in SharePoint 2013.
Create WCF Service in SharePoint
Because you cannot add a WCF service Template in SharePoint 2013 project, you create a WCF service application in advance, dragging the contract interface and the SVC service to SharePoint Project. So you need the following steps:
1. Create WCF Service Application
2. Create a SharePoint mapped Folder ISAPI in SharePoint Projectbecause the services (. svc) that are accessible in SharePoint 2013 exist: C:\Program files\ Common Files\Microsoft Shared\Web Server Extensions\15\isapi folder, corresponds to the virtual directory _vti_bin in IIS.
3. Drag the SVC for WCF Service application to the ISAPI folder as follows:
4. Modify the namespace and add the assembly reference as follows:
5. Because SharePoint project requires a strong name key File, referencing this assembly requires providing Publictoken (sn-t Assembly.dll, using the method reference: http:// www.cnblogs.com/OceanEyes/p/custom-provider-in-sharepoint-2013-fba-authentication.html)
6. Modify Svc
<%@ ServiceHost language= "C #" debug= true "service=" Eyes.customrestservice.service1,eyes.customrestservice, version=1.0.0.0,culture=neutral,publickeytoken= bf65dbaa17f24124 "codebehind=" Service1.svc.cs "%>