Project Background
There are 3 ways to create a custom ASP. NET Web service in SharePoint 2010 according to customer requirements (I know). Less nonsense, the following list:
How to create
-
MSDN Official Blog One of its own creates an ASP. aspx Web service.http://msdn.microsoft.com/zh-cn/library/ms464040 (v=office.14), but it does not recommend this way.
The class Library project is packaged webservice by creating a class library project.
MSDN is the recommended way to create a webservice with WCF.
Note : only introduce the 2nd, 3 ways of implementation, the first way of implementation has been outdated AH. Haha, huh!
Specific Implementation1. By creating a class library project
Create a class project project and force the signature. For example:
Then reference System.web.service.webservice, modify Class1 inherit webservice. Set the Web interface you need to provide via properties [WebMethod].
Create a Web service project in the current project, and then remove both ". Asmx.cs" and "web. config", and then change the class property of the. asmx file. Change to your service in class project, so that the background class library of the ASMX file points to the class of the class library project you created.
Then separate the asmx files, put them in the SharePoint _layouts directory, and restart IIS. Then set the SharePoint _layouts for anonymous access to this ASMX file. The last direct reference on it is possible.
SharePoint 2010 Create a custom ASP. NET Web Service (top)