Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

Getting to the query string (GET request array) inside a web service in .NET

I'm looking to find a way to access the .net query string contained in the standard ASP.NET request object inside a web service. In other words if I set a SOAP web service to this url:

http://localhost/service.asmx?id=2

Can I access the ID Get variable?

like image 753
Nikola Stjelja Avatar asked Nov 18 '08 09:11

Nikola Stjelja


2 Answers

I just looked for "Request" of the context in asmx file and I saw that. But I'm not sure if it is right.

this.Context.Request.QueryString["id"];
like image 85
Ali Ersöz Avatar answered Nov 03 '22 02:11

Ali Ersöz


HttpContext.Current.Request.QueryString["id"]

like image 43
AnthonyWJones Avatar answered Nov 03 '22 01:11

AnthonyWJones