How can I write an ASMX Webservice on SharePoint 2013, for example http://Sample/myWebService.asmx?
?
2 Answers
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
-
1Please 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
-
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.
-
notice that it is much easier to deploy to
_layouts
folder, rather than using_vti_bin
, since on the latter you must manually createdisco
&wsdl
files and editspdisco.asmx
– itshoCommented Jan 20, 2015 at 9:41