I’ve got a asmx service that takes a single int parameter. I can open the URL to the service and see the service description screen. From here I can enter the query parameters into a form and invoke the web service.
Is there any way to invoke a web service directly from a URL/query string?
This doesnt work:
http://localhost:4653/MyService.asmx?op=MyWebMethod&intParameter=1
Any ideas? I’d really like to be able to do this from a standard link due to some deployment issues. Am I going to have to wrap the request in a normal aspx page?
You can decorate your method to allow HTTP GET requests, which should in turn do what you’re looking for like so:
And edit the web.config :
Then you’ll be able to call this method like so:
http://mysite.com/Service.asmx/MyNiftyMethod?myint=12345EDIT: Note that this method of performing GET requests does come with some security risks. According to the MSDN documentation for UseHttpGet: