Thursday, February 19, 2009

Calling a web-method from a hyperlink

I've observed this trend in tech-industry, we will find many articles on difficult topics but its very difficult to find answers to simple questions.
I once faced such a question and figured it out after some experimenting.
The question is how to call a web method (a method exposed by a web service) from a plain HTML web page??? In other words how to call webmethods directly??? Well, folks its really simple to call a web-method from a hyperlink... The HTML goes like this...

<a href = "http://localhost/abcGateway/xgateway.asmx/dostartRecording?recchannel=19">
Start Recording

Where I have a web-service whose main page is xgateway.asmx, and it exposes a web method "dostartRecording", this web-method takes a parameter "recchannel".
 Hi ho now you can enjoy calling a web method directly from your web page.

1 comment:

Feel free to talk back...