Actually, after a little more research, I think I'm going down the right
path, but I'm having one problem.
I'm setting the "http.proxyHost" and "http.proxyPort" system properties,
and I'm using the Commons Codec Base64 class to encode the
"user:password" pair, and setting the stringified byte value from that
on the "Proxy-Authorization" mime header.
The result looks somewhat like this:
String pair = getProxyUser() + ":" + getProxyCredentials();
System.out.println("pair[" + pair + "]");
Base64 encoder = new Base64();
byte[] encodedBytes = encoder.encode(pair.getBytes());
System.out.println("encoded[" + new String(encodedBytes) + "]");
mimeHeaders.addHeader("Proxy-Authorization",
new String(encodedBytes));
Unfortunately, this isn't working. I get a connection timeout. Before
talking to someone that hosts the third-party service, is there anything
obviously wrong with this that I need to fix?
> -----Original Message-----
> From: Karr, David
> Sent: Tuesday, July 11, 2006 3:19 PM
> To: users_at_saaj.dev.java.net
> Subject: [SAAJ-USR] SOAPConnection through authenticated proxy
>
> In the past, I've used the Jakarta Commons HttpClient package
> to connect to external URLs through our authenticated proxy.
> I now have some code that uses "SOAPConnection.call()", which
> I have to use to make a call through our authenticated proxy.
> Is there a reasonable interface that would allow me to
> configure this? Does this require setting certain system
> properties? I imagine this would be setting
> "http.proxyHost", at least, but I don't see any way to set
> connection properties, like I'll need in order to send the
> "Proxy-Authorization" HTTP header.
>
> I may be limited by the fact that I'm using JWSDP 1.1
> (although I don't see anything new in this area in JWSDP 1.3).
>