4

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.

Élodie Petit
  • 1,267
  • 3
  • 22
  • 35

3 Answers3

3

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" %>
int32
  • 478
  • 3
  • 10
1

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.

Amicable
  • 221
  • 5
  • 21
0

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
RWL01
  • 1,301
  • 4
  • 21
  • 43