Creating custom web services in a SharePoint 2010 environment

I needed to write a custom web services to read and return all Term info based on a given Term name. I need that info to make adjustments to the File Classification Infrastructure scripts to upload files from the file system to SharePoint and set the correct Terms/Tags on the files.

Because SharePoint 2010 already are Ajax/Javascript enabled you don't need to make adjustments to SharePoint, but follow these very simple steps:

  1. Add a App_Code catalog to your web application, e.g. c:\inetpub\wwrwroot\wss\virtualdirectoris\80\App_Code
  2. Copy MySimpleService.asmx to c:\inetpub\wwrwroot\wss\virtualdirectoris\80 or to [14]/Template/Layouts/..
  3. Copy MySimpleService.asmx.cs to c:\inetpub\wwrwroot\wss\virtualdirectoris\80\App_Code
  4. Try your service: http://sharepoint2010/MySimpleService.asmx

That's it!

There are for certain issues, but it all depends on your scneario and what you need to do; KISS - Keep It Simple Stupid - but don't be stupid! :-) Of course you need to wrap-up and make a solution package of everything before you make it into a production environment...

No comments: