By using this site, you agree to our updated Privacy Policy and our Terms of Use. Manage your Cookies Settings.
448,495 Members | 1,307 Online
Bytes IT Community
+ Ask a Question
Need help? Post your question and get tips & solutions from a community of 448,495 IT Pros & Developers. It's quick & easy.

webclient uploaddata - strange problem

P: n/a
I have a very strange problem that is driving me nuts. My application
is using the webclient object to send data to a webserver running on a
unix box. We use 2 different environments, 1 for development and 1
for a staging environment. I'm using an invalid servlet name in the
url deliberately in order to test my logic for basic communication
problems.

When I run the code against the staging box, I get a 5xx error back,
which is what I would expect to happen. No problem. When I run the
same code against the development box, I get a 417 (expectation
failed) error. I dont understand why. It gets a little more
interesting. If I use the exact same URL in addressline of IE, I
correctly get 5xx error from IE. Its only when running the code, I
get this error. If I look at the webserver logs, the invalid access
from IE is there, but not the one from the code, so it appears this
txn is never getting out of the machine. If I use 127.0.0.1 as the
IP, it does return the 5xx error. These are http transactions, not
https. I am behind a proxy server, but I thought the webclient object
would use those bypass settings.

Here is the code I use to do the upload to the url. Its pretty
straightforward.

oWebClient.Headers.Add("Content-Type",
"application/x-www-form-urlencoded")
requestData = oEncoder.GetBytes(xmlString)
responseData = oWebClient.UploadData(strEnvironmentURL, requestData)
Any ideas ? I'm certainly not getting anywhere .......

Many thanks....
Mark
Nov 21 '05 #1
Share this question for a faster answer!
Share on Google+

This discussion thread is closed

Replies have been disabled for this discussion.