I know that this is a very old question, but did not answer it properly, so here it is:
Each * .ASMX request is by default processed by System.Web.Services.Protocols.WebServiceHandlerFactory .
Looking into the source code of this class in the .NET reflector, it is possible to have a webservice without an ASMX file, but you will need to call the internal CoreGetHandler method through reflection.
The following method will take your web service and return it to IHttpHandler.
public IHttpHandler GetHttpHandlerForWebService(WebService webService, HttpContext context) { var webServiceType = webService.GetType(); var wshf = new System.Web.Services.Protocols.WebServiceHandlerFactory(); var coreGetHandler = wshf.GetType().GetMethod("CoreGetHandler"); var httpHandler = (IHttpHandler)coreGetHandler.Invoke(wshf, new object[] { webServiceType, context, context.Request, context.Response }); return httpHandler; }
Once you have httphandler, you just need to call
httpHandler.ProcessRequest (context)
Done. There is no ASMX and no entries in web.config.
lubos hasko
source share