Question

In my asp.net application I have web service ~/service.asmx and generic handler ~/handler.ashx. How can I call web service's method from the generic handler? For example, in web service I have string SayHello(string name) method. To call it I need to make a request to /service.asmx/SayHello. What I need is to call that when user requests the generic handler /handler.ashx.

Was it helpful?

Solution

Add service reference (which will create a proxy class) and create an instance of Webservice proxy class and call this method. If web-service is located in your current web-app then you may instantiate that class and call method as we call the regular method.

Licensed under: CC-BY-SA with attribution
Not affiliated with StackOverflow
scroll top