You may already read this following article “Writing Custom Web Service for SharePoint Products and Technologies” (http://msdn.microsoft.com/en-us/library/dd583131(v=office.11).aspx) or “Walkthrough: Creating a Custom ASP.NET Web Service” (http://msdn.microsoft.com/en-us/library/ms464040.aspx). The steps can be summarized as follows:
- Create normal ASPNET web service
In this step you will create ASPNET Web Services using Visual Studio as you always do. From this step, you will have <Service>.asmx, where <Service> is your web service asmx file.
- Create corresponding .disco file and a .wsdl file
In this step you will create extract of DISCOvery file and WSDL of ASPNET web service from step #1, and add reference to Microsoft.SharePoint assembly. From this step, you will have 2 files <Service>disco.aspx and <Service>wsdl.aspx.
- Copy the 3 files to _vti_bin (12hive\ISAPI)
In this step you will copy the 3 files (<Service>.asmx, <Service>disco.aspx and <Service>wsdl.aspx) into 12hive\ISAPI. Of course in real deployment, you can use WSP.
- Register the new web service in spdisco.aspx
In this step you will modify built-in SharePoint file spdisco.aspx, so that your web service will be recognized by SharePoint.
Until here you will have working custom web service in SharePoint but are you sure that your SharePoint farm is still supported?
If you read “Modifying Built-In SharePoint Files” (http://msdn.microsoft.com/en-us/library/bb803457(v=office.12).aspx) rules, the step #4 is unsupported. Step#4 is to modify spdisco.aspx so that the custom web service will work.
So do you still want to built custom web service using that technique?
My suggestion, think twice! In fact you can still use ASPNET web service without SharePoint integration – it will work but lost SharePoint context. Moreover, you can’t tell WSP to modify spdisco.aspx unless you use event handler – which mean more complexity.