First, you need to download two things to follow along:
Next, follow these steps:
- Create a new project in STSDEV, use the empty project C# assembly
- Add a new Web Service Application Project to your solution
- Add your web method to your web service. (If you just want to test this out, the default HelloWorld will work)
- Run the WSS Web Service Helper against your .asmx file (in your web service project). This will autogenerate your wsdl and disco .aspx files.
- Copy the .asmx file and the .cs codebehind (your webservice) and the two .aspx files generated by the WSS Web Service Helper and place them into your Rootfiles/ISAPI folder in your STSDev project.
- Go to your .asmx file and delete the CodeBehind attribute of the Webservice tag and place the fully qualified assembly string into the Class attribute (Namespace.Class, Assembly, Version, Culture, PublicKey)
- Go into the Generated *disco.aspx file and for both of the soap tags replace the address attribute with <% SPEncode.WriteHtmlEncodeWithQuote(Response,SPWeb.OriginalBaseUrl(Request), '"'); %>
- Next go to the *wsdl.aspx file and (at the bottom of the file) replace the location attribute of the soap12:address tag with <% SPEncode.WriteHtmlEncodeWithQuote(Response,SPWeb.OriginalBaseUrl(Request), '"'); %>
- Also in both the *disco.aspx and *wsdl.aspx files you need to change the <@ assembly tag to this:
<%@ Assembly Name="Microsoft.SharePoint, Version=126.96.36.199, Culture=neutral, PublicKeyToken=71e9bce111e9429c" %>
because the .disco generator puts the wrong version and adds an extra Microsoft.SharePoint to the assembly reference.
- Deploy your project and test.
- Finally, if you have trouble, go here for troubleshooting, the tips are at the bottom of the article.