Skip to Main Content

Java EE (Java Enterprise Edition) General Discussion

Announcement

For appeals, questions and feedback about Oracle Forums, please email oracle-forums-moderators_us@oracle.com. Technical questions should be asked in the appropriate category. Thank you!

Unable to tunnel through proxy. Proxy returns "HTTP/1.1 400 Bad Request"

977030Dec 3 2012 — edited Dec 3 2012
Hi,
I am trying to send a request to a web service using an HttpURLConnection and through a proxy as well.
my Code:
Proxy proxy = new Proxy(Proxy.Type.HTTP, new InetSocketAddress(theHost, thePort));
URL url = new URL(theUrl);
HttpURLConnection con = (HttpURLConnection)url.openConnection(proxy);
con.setRequestMethod("POST");
con.setRequestProperty("Content-type", "text/xml; charset=utf-8");
con.setDoOutput(true);
con.setRequestProperty("SOAPAction", theUrl);
OutputStream reqStream = con.getOutputStream();

At this line^ I get: Unable to tunnel through proxy. Proxy returns "HTTP/1.1 400 Bad Request".
If it's relevant, I am using Tomcat as well and Netbeans,

Any help with this exception would be appreciated, thanks ...
Dimitris
Comments
Locked Post
New comments cannot be posted to this locked post.
Post Details
Locked on Dec 31 2012
Added on Dec 3 2012
1 comment
5,263 views