Take the 2-minute tour ×
SharePoint Stack Exchange is a question and answer site for SharePoint enthusiasts. It's 100% free, no registration required.

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.

share|improve this question

3 Answers 3

up vote 2 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" %>
share|improve this answer
    
Everything was OK except the PublicKeyToken. Thank you! –  Élodie Petit Oct 10 '11 at 14:48

I had the same error - stripping back my code to a simpler form revealed the issue was that I hadn't marked my DTO class with [DataContract] and [DataMember] attribute. I also had to mark my WebMethods as non-cls compliant types.

I got the information that lead me to the solution from the output window of VS.

share|improve this answer

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\Microsoft.VisualStudio.SharePoint.targets
  • Searched for "<TokenReplacementFileExtensions>"
  • Added ";asmx" to the list
share|improve this answer

Your Answer

 
discard

By posting your answer, you agree to the privacy policy and terms of service.

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