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.

3 Answers 3

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" %>
1
  • Everything was OK except the PublicKeyToken. Thank you! Commented Oct 10, 2011 at 14:48
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.

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

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy.

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