Tek-Tips is the largest IT community on the Internet today!

Members share and learn making Tek-Tips Forums the best source of peer-reviewed technical information on the Internet!

  • Congratulations strongm on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

Pass Query String to WebService 1

Status
Not open for further replies.

MeonR

Programmer
Aug 16, 2002
97
US
I want to pass a query string with a parameter to a webservice. Something like this:


This does not work.

[WebMethod]
public void StartIt(string someParam)
{
string someVal = HttpContext.Current.Request.QueryString.Get(someParam);
//Do whatever...

}

Is it even possible to do this? If so, what should the URL be? Its going to be placed into a simple html e-mail.

TIA
mEONr

"The beatings will continue until morale improves
 
some options
1. encode the data string before appending to the query string.
2. use POST instead of GET

Jason Meckley
Programmer
Specialty Bakers, Inc.

faq855-7190
faq732-7259
 
Thanks Jason:

I suppose I could use something like php's urlencode. But the post? This is only going to be a url or series of URL's in an html e-mail It want have a form tag. Does .NET have a way around this?

TIA
meonR

"The beatings will continue until morale improves
 
This is only going to be a url or series of URL's in an html e-mail It want have a form tag. Does .NET have a way around this?

the statement doesn't make any sense. could you clarify?

Jason Meckley
Programmer
Specialty Bakers, Inc.

faq855-7190
faq732-7259
 
Ok, I get how to encode the data for the URL, but how do I use POST instead of GET?

"The beatings will continue until morale improves
 
that I'm not entirely sure on, but I know it's possible. Google is a good place to start

Jason Meckley
Programmer
Specialty Bakers, Inc.

faq855-7190
faq732-7259
 
Thanks.



"The beatings will continue until morale improves
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top