I created an ASP.Net Web service in SharePoint 2010 by completing the tutorial in the following address:

http://msdn.microsoft.com/en-us/library/ms464040.aspx

When I navigate to the service address which is located under ISAPI folder, I get a 404. I can see the WSDL of the service by appending ?wsdl to the address that SharePoint says cannot be found.

Any ideas?

Thanks.

link|improve this question

feedback

2 Answers

up vote 0 down vote accepted

The reference to your deployed code (.dll in GAC) is most likely pointing to a wrong location, open the .asmx file in notepad and verify that it is correct/has correct formatting. Example:

<%@ WebService Language="C#" Class="MyAssemblyName, MyClassName, Version=1.0.0.0, Culture=neutral, PublicKeyToken=4e93b0eb4e651e96" %>
link|improve this answer
Everything was OK except the PublicKeyToken. Thank you! – Élodie Petit Oct 10 '11 at 14:48
feedback

Ran into the same issue but resolved it differently. I used $SharePoint.Project.AssemblyFullName$ to reference my assembly. This works fine except for .asmx files.

I had to modify they Microsoft.VisualStudio.SharePoint.targets file in my development environment for this to work. I did this by going to:

  • C:\Program Files (x86)\MSBuild\Microsoft\VisualStudio\v10.0\SharePointTools
  • Searched for "<TokenReplacementFileExtensions>"
  • Added ";asmx" to the list
link|improve this answer
feedback

Your Answer

 
or
required, but never shown

Not the answer you're looking for? Browse other questions tagged or ask your own question.