Freigeben über


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

Comments

  • Anonymous
    January 04, 2008
    Today's post is more observational than informational. Enjoy. It's sometimes possible to write XML without

  • Anonymous
    January 06, 2008
    The comment has been removed

  • Anonymous
    January 07, 2008
    Hi EV, That's answered here: http://blogs.msdn.com/drnick/archive/2007/09/10/more-about-client-ip-addresses.aspx.

  • Anonymous
    January 07, 2008
    Thanks Nicholas, one more reason to upgrade to Orcas :)