How to implement WebService without phsyical.ASMX file?

How can I create a WebService without the presence of an .ASMX file? (No WSE 3.0 or WCF)

For example, my web service looks like

[WebService(Namespace = "http://tempuri.org/")] [WebServiceBinding(ConformsTo = WsiProfiles.BasicProfile1_1)] public class myService : System.Web.Services.WebService { //... 

Note:
He published well how to create and implement a common HTTP handler via web.config like:

 // Concept.Handler1Class namespace Concept { public class Handler1Class : IHttpHandler { //... 

and web.config

 <handlers> <add name="myHandler1" verb="GET" path="myThing.aspx" type="Concept.Handler1Class" /> <!-- ... 

In the above example, there is no physical .aspx file.


I want to do the same with my web services: so that they exist only in compiled code without a front-end accompanying file.

Thanks.

+4
source share
1 answer

This codedroject page shows how to do this: http://www.codeproject.com/KB/aspnet/wsinaclasslibrary.aspx


An excerpt for posterity. See the link above for a complete solution.

C # Web Service Class

 namespace WSLibrary { public class WSTest : WebService, IHttpHandlerFactory { //... 

Web.config

 <httpHandlers> <add path="WSTest.asmx" verb="*" type="WSLibrary.WSTest" validate="false"/> <!-- ... --> </httpHandlers> 
+6
source

Source: https://habr.com/ru/post/1345305/


All Articles