SharePoint 2010 Create a custom ASP. NET Web Service (top)

Source: Internet
Author: User

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
      1. 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.

      2. The class Library project is packaged webservice by creating a class library project.

      3. 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)

Contact Us

The content source of this page is from Internet, which doesn't represent Alibaba Cloud's opinion; products and services mentioned on that page don't have any relationship with Alibaba Cloud. If the content of the page makes you feel confusing, please write us an email, we will handle the problem within 5 days after receiving your email.

If you find any instances of plagiarism from the community, please send an email to: info-contact@alibabacloud.com and provide relevant evidence. A staff member will contact you within 5 working days.

A Free Trial That Lets You Build Big!

Start building with 50+ products and up to 12 months usage for Elastic Compute Service

  • Sales Support

    1 on 1 presale consultation

  • After-Sales Support

    24/7 Technical Support 6 Free Tickets per Quarter Faster Response

  • Alibaba Cloud offers highly flexible support services tailored to meet your exact needs.