简体   繁体   中英

How to publish web service in ASP.Net?

Below url is web service which I hosted: http://monocept.net/vlt/html/AutoComplete.asmx

when I am invoking this service it calls web method GetCompleteList(). This method implementation is defined in AutoComplete.asmx.cs file. When I invoking this service it throws exception as HTTP 404, where as in my local machine service is working fine and able to hit GetCompleteList() Web method.

The error page is actually dumping out the exception/stack trace in a HTML comment:

[HttpException]: The controller for path '/vlt/html/AutoComplete.asmx/GetCompleteList' was not found or does not implement IController.
   at System.Web.Mvc.DefaultControllerFactory.GetControllerInstance(RequestContext requestContext, Type controllerType)
   at System.Web.Mvc.DefaultControllerFactory.CreateController(RequestContext requestContext, String controllerName)
   at System.Web.Mvc.MvcHandler.ProcessRequestInit(HttpContextBase httpContext, IController& controller, IControllerFactory& factory)
   at System.Web.Mvc.MvcHandler.BeginProcessRequest(HttpContextBase httpContext, AsyncCallback callback, Object state)
   at System.Web.Mvc.MvcHandler.BeginProcessRequest(HttpContext httpContext, AsyncCallback callback, Object state)
   at System.Web.Mvc.MvcHandler.System.Web.IHttpAsyncHandler.BeginProcessRequest(HttpContext context, AsyncCallback cb, Object extraData)
   at System.Web.HttpApplication.CallHandlerExecutionStep.System.Web.HttpApplication.IExecutionStep.Execute()
   at System.Web.HttpApplication.ExecuteStep(IExecutionStep step, Boolean& completedSynchronously)

I'm not familiar with MVC, so I really can't give you a solid answer, but researching that exception turns up a few results .

You haven't defined a controller for this path. It is MVC error. Your service doesn't has a business logic.

您确定要在global.asax文件中排除路由吗?

routes.IgnoreRoute("{resource}.asmx/{*pathInfo}");

The technical post webpages of this site follow the CC BY-SA 4.0 protocol. If you need to reprint, please indicate the site URL or the original address.Any question please contact:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM