Solved

How to do  ASP.NET WebForms routing for asmx Web Services?

Posted on 2012-03-23
3
887 Views
Last Modified: 2012-05-29
Hi experts! I'm trying to enable ASP.NET WebForms routing to an asmx Web Service.

The following returns a "Type 'myproject.myservice' does not inherit from 'System.Web.UI.Page'" error:

routes.MapPageRoute(
            "The_Route_Name_For_This_Service",
            "somethingfantastic/",
            "~/services/myservice.asmx?op=MyFunction"
        )

Open in new window


How can I add paths to asmx web services to my RouteCollection?

Your help is greatly appreciated!
0
Comment
Question by:Drevo
[X]
Welcome to Experts Exchange

Add your voice to the tech community where 5M+ people just like you are talking about what matters.

  • Help others & share knowledge
  • Earn cash & points
  • Learn & ask questions
3 Comments
 
LVL 20

Accepted Solution

by:
BuggyCoder earned 500 total points
ID: 37759113
you cannot route a request to an aspx page, which is a class derived from page class which is the page's HTTPHandler to a asmx page.

By default Instance of Page is created whenever a request is made for an aspx page, however i think if you can write your own HttpModule, you can override this behaviour and have your own handler get called.
0
 

Author Comment

by:Drevo
ID: 37772783
Thanks for your comment BuggyCoder! Though you can route requests to aspx pages. I think you're right that something needs to be overridden to route to an asmx web service. I don't know exactly how though, which leaves this question still open. Perhaps some kind of extension of IRouteHandler and/or IHttpHandler?

In the meantime I'm just checking for specific URL path patterns in Application_BeginRequest and doing a Context.RewritePath to the matched web service.
0

Featured Post

Independent Software Vendors: We Want Your Opinion

We value your feedback.

Take our survey and automatically be enter to win anyone of the following:
Yeti Cooler, Amazon eGift Card, and Movie eGift Card!

Question has a verified solution.

If you are experiencing a similar issue, please ask a related question

Introduction This article shows how to use the open source plupload control to upload multiple images. The images are resized on the client side before uploading and the upload is done in chunks. Background I had to provide a way for user…
It was really hard time for me to get the understanding of Delegates in C#. I went through many websites and articles but I found them very clumsy. After going through those sites, I noted down the points in a easy way so here I am sharing that unde…
In this video we outline the Physical Segments view of NetCrunch network monitor. By following this brief how-to video, you will be able to learn how NetCrunch visualizes your network, how granular is the information collected, as well as where to f…
Monitoring a network: why having a policy is the best policy? Michael Kulchisky, MCSE, MCSA, MCP, VTSP, VSP, CCSP outlines the enormous benefits of having a policy-based approach when monitoring medium and large networks. Software utilized in this v…
Suggested Courses

636 members asked questions and received personalized solutions in the past 7 days.

Join the community of 500,000 technology professionals and ask your questions.

Join & Ask a Question