WebRequest with no UrlEncode text.

T

ThyRock

I am working on a WebRequest with xml data. The web service accepts the
query string with no url encoding. I must pass the <> characters as they are
in the query string. If these characters are url encoded the service
rejects the request. How can I pass these characters to this service with
url encoding. I use C#.
 
T

ThyRock

My question should have been.
How can I pass these characters to this service with NO url encoding.
 
D

Dan Rogers

Try and figure out why the URL request isn't being translated properly on
the service side. You have to pass the documents encoded. Try this: Go
to the test page, click "invoke" and capture the query string (via a trace
on the far end). See what's different. Often when people try to cobble
together their own XML via concatenation, it ends up with mismatched
elements (spelling/case) or mismatched brackets.
--------------------
 
T

ThyRock

Dan,
Thanks very much for your reply.
I am working with the US Postal Service WebTools test API. This API Url is
http://testing.shippingapis.com/ShippingAPITest.dll It takes a query string
as follows:

?API=RateV2&XML=<RateV2Request USERID="userid" PASSWORD="password"> <Package
ID="0"> <Service>PRIORITY</Service> <ZipOrigination>10022</ZipOrigination>
<ZipDestination>20008</ZipDestination> <Pounds>10</Pounds> <Ounces>5</Ounces>
<Container>Flat Rate Box</Container>
<Size>REGULAR</Size></Package></RateV2Request>

I can use this url and query string from the location bar of the web
browser and it will return the correct xml response. If this query string is
encoded, the dll will return an error. The USPS dll is not decoding an
encoded query string. The USPS is not up to date with the latest Xml
technology. There is no xml description page and no invoke for the method.
The USPS has a service connection dll for Windows NT 4.0 only. I am very
limited to what I can do with this service provider.

Thanks for your help.
 
D

Dan Rogers

You might have to bite the bullet and manually create an HTTP request
packet this way. I know you can get a web service call to use HTTPGet
(this is what this is) but the URLEncoding is almost a must. If they
aren't taking things URLEncoded, it means they're likely open to all kinds
of hack attacks. Too bad.

--------------------
 
T

ThyRock

Dan,
Thanks for your help. I have worked out the problem with the service
provider.
Thanks again.
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Members online

No members online now.

Forum statistics

Threads
473,997
Messages
2,570,241
Members
46,831
Latest member
RusselWill

Latest Threads

Top