2

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

Robert Lindgren
  • 24,520
  • 12
  • 53
  • 79
user3506959
  • 21
  • 1
  • 1
  • 2

2 Answers2

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

Rob Windsor
  • 12,648
  • 25
  • 39
  • 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 :) – Robert Lindgren Apr 07 '14 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. – Rob Windsor Apr 08 '14 at 01: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 Apr 08 '14 at 06:12
  • Thaaank You, Rob! :) – Gennady G Mar 13 '16 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.

Damjan Tomic
  • 3,646
  • 3
  • 19
  • 18
  • 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 Jan 20 '15 at 09:41