Call web service method from generic handler

1.7k views Asked by At

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.

1

There are 1 answers

6
KV Prajapati On BEST ANSWER

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.