I am getting an Exception while trying to access Web services behind a proxy server setup. I am using JWSDP(
Java Web Services DevelopmentPack)for the development.
I am using the following fragment of code in my client program.
//Setting the proxy properties
Properties myprops = new Properties();
myprops.setProperty("http.proxySet","true");
myprops.setProperty("http.proxyHost","hostname");
myprops.setProperty("http.proxyPort","port");
//encoding the authentication information
String userid = new sun.misc.BASE64Encoder().encode("user".getBytes());
String password = new sun.misc.BASE64Encoder().encode("password".getBytes());
myprops.setProperty("http.proxyUserName",userid);
myprops.setProperty("http.proxyPassword",password);
//Setting the system properties
Properties props = System.getProperties();
Enumeration iter = myprops.propertyNames();
while (iter.hasMoreElements()) {
String s = (String) iter.nextElement();
props.put(s, myprops.getProperty(s));
//Rest of the codes are for constructing the
soap connection and message object.
I am getting proxy authentication error, listed below
javax.xml.soap.SOAPException: Bad response: (407Proxy Authentication Required ( The ISA Server requi
res authorization to fulfill the request. Access to the Web Proxy service is denied. )
at com.sun.xml.messaging.saaj.client.p2p.HttpSOAPConnection.post(HttpSOAPConnection.java:267)
When we checked in our office proxy the request is coming from an anonymous user instead of the mentioned user id and password.
We are getting the same problem when we are suing the Apache AXIS tool kit.
In Apache SOAP tool kit there is an option for setting the proxy user id and password by using SOAPHTTPConnection. But we need to
use either JWSDP or Apache AXIS.
Solution to this problem would be highly appreciated.
Regards,
Saji