Welcome to MSDN Blogs Sign in | Join | Help

Accessing the Query String

How do I get access to the query string of an HTTP request when processing a message?

The query string isn't one of the properties available on the new WebOperationContext but you can still get access to it through the HTTP request message property.

MessageProperties properties = OperationContext.Current.IncomingMessageProperties;
HttpRequestMessageProperty requestProperty = (HttpRequestMessageProperty)properties[HttpRequestMessageProperty.Name];
string queryString = requestProperty.QueryString;

Next time: Taking Action on Client Close

Published Friday, January 04, 2008 5:00 AM by Nicholas Allen

Comments

Friday, January 04, 2008 1:53 PM by Nicholas Allen's Indigo Blog

# Get a Real XML Parser

Today's post is more observational than informational. Enjoy. It's sometimes possible to write XML without

Sunday, January 06, 2008 2:27 PM by EV

# re: Accessing the Query String

thanks to sharing this tip

is some option exist to retrieve the client ip ?

cant find it in IncomingMessageProperties

Monday, January 07, 2008 12:44 PM by Nicholas Allen

# re: Accessing the Query String

Monday, January 07, 2008 2:19 PM by EV

# re: Accessing the Query String

Thanks Nicholas, one more reason to upgrade to Orcas :)

New Comments to this post are disabled
 
Page view tracker