javx.xml.soap and Proxy authorization
843790Nov 15 2006 — edited Nov 15 2006Hi there,
first of all I need to say sorry for my bad english. I'll try to do my best ;-)
I'm trying to connect to a SOAP-Server through a firewall that needs authorization.
I'll post the code that successfully do a soap-query without proxys authorization (that I found on some webpages):
---
SOAPConnectionFactory scf = SOAPConnectionFactory.newInstance();
SOAPConnection conn = scf.createConection();
MessageFactory mf = MessageFactory.newInstance();
SOAPMessage msg = mf.createMessage();
SOAPPart sp = msg.getSOAPPart()
... //manipulating the soapbody, methodname, header, namespaces, etc.
msg.saveChanges();
URL endpoint = new URL("http://myserver");
//perform SOAP call
SOAPMessage response = conn.call(msg,endpoint);
conn.close();
return response;
---
This works fine to query a soapserver without a proxy.
For a (http-)proxy without authorization, I use the
System.getProperties().put("http.proxyHost" , "192.168.1.99");
System.getProperties().put("http.proxyPort" , "3128");
This works too.
Now, I need proxy authorization.
On some pages/groups, I saw property-settings like
System.getProperties().put("http.proxyUser" , "user");
System.getProperties().put("http.proxyPassword" , "pass");
and
System.getProperties().put("proxyUsername" , "user");
System.getProperties().put("proxyPassword" , "pass");
but they didn't work!
Theese properties are either out of date or didn't even exist in the past ( see http://java.sun.com/j2se/1.5.0/docs/guide/net/properties.html )
So my question is, how can I set up a proxy username and password.
I remember, I'm not using Apache's AXIS or SOAP - just the SOAP-implementation by sun (javax.xml.soap)
Regards
crumble