2

How can I write an ASMX Webservice on SharePoint 2013, for example http://Sample/myWebService.asmx??

2 Answers 2

4

I have a detailed walkthrough that shows how to do this. The post was written for SharePoint 2010 but it will work for SharePoint 2013.

Walkthrough: Creating a Custom ASP.NET (ASMX) Web Service in SharePoint 2010

enter image description here

4
  • 1
    Please add more information to the post. Link-only answers are normally not happily received, and less so when linking to your private blog :) Commented Apr 7, 2014 at 18:32
  • My answer stands as is. I will leave it up to the Stack Overflow community to decide if they like it or not with their votes. Commented Apr 8, 2014 at 1:56
  • 4
    -1 Link Only Answer. Please don’t add just a link as answer to a question. If the link breaks, the answer you provided will not be useful for future visitors. Provide an answer of your own and use the link as reference. If needed, you can block quote the content from your link. More information is found in our help center, especially How do I write a good answer
    – Benny Skogberg
    Commented Apr 8, 2014 at 6:12
  • Thaaank You, Rob! :)
    – Gennady G
    Commented Mar 13, 2016 at 12:39
3

The simplest way is to write your web service code directly in asmx file and save it in:

C:\Program Files\Common Files\Microsoft Shared\Web Server Extensions\15\TEMPLATE\LAYOUTS\SomeFolder\MyWebService.asmx

Then you can call it like this:

http://mysiteurl/_layouts/15/SomeFolder/MyWebService.asmx

It would be better, of course, to compile your web service, deploy the dll file in GAC, and then also copy asmx file to some location in Layouts folder as in my example.

1
  • notice that it is much easier to deploy to _layouts folder, rather than using _vti_bin, since on the latter you must manually create disco & wsdl files and edit spdisco.asmx
    – itsho
    Commented Jan 20, 2015 at 9:41

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.