0

I'm calling a SOAP web service for two way SSL authentication, passing through a proxy. I'm getting the following error while calling the soap-webservice.

com.sun.xml.ws.client.ClientTransportException: HTTP transport error: java.io.IOException: Unable to tunnel through proxy. Proxy returns "HTTP/1.1 403 Forbidden"
at com.sun.xml.ws.transport.http.client.HttpClientTransport.getOutput(HttpClientTransport.java:131)
at com.sun.xml.ws.transport.http.client.HttpTransportPipe.process(HttpTransportPipe.java:212)
at com.sun.xml.ws.transport.http.client.HttpTransportPipe.processRequest(HttpTransportPipe.java:136)
at com.sun.xml.ws.transport.DeferredTransportPipe.processRequest(DeferredTransportPipe.java:110)

I'm setting the following properties for the BindingProvider

bp.getRequestContext().put("com.sun.xml.ws.developer.JAXWSProperties.SSL_SOCKET_FACTORY", socketFactory);
bp.getRequestContext().put("com.sun.xml.internal.ws.transport.https.client.SSLSocketFactory", socketFactory);
 bp.getRequestContext().put("com.sun.xml.ws.transport.https.client.SSLSocketFactory", socketFactory);
bp.getRequestContext().put(JAXWSProperties.SSL_SOCKET_FACTORY, socketFactory);  

bp.getRequestContext().put("proxySet","true");
bp.getRequestContext().put("http.proxyHost","host.com");
bp.getRequestContext().put("http.proxyPort","8080");
bp.getRequestContext().put("http.proxyUser","****");
bp.getRequestContext().put("http.proxyPassword","****");
bp.getRequestContext().put("https.proxyHost","host.com");
bp.getRequestContext().put("https.proxyPort","8080");
bp.getRequestContext().put("https.proxyUser","****");    
bp.getRequestContext().put("https.proxyPassword","****");

Thanks!

fmp
  • 19
  • 5

1 Answers1

0

First of all try to verify if the SSL certificate is well installed. Then try to add this VM Args :

-Djavax.net.ssl.trustStore=locationOfYourTrustedStore.jks
-Dcom.sun.xml.ws.transport.http.client.HttpTransportPipe.dump=true
-Dcom.sun.xml.ws.transport.http.HttpAdapter.dump=true
-Dcom.sun.xml.internal.ws.transport.http.client.HttpTransportPipe.dump=true
-Dcom.sun.xml.internal.ws.transport.http.HttpAdapter.dump=true

Also add this line in your implementation code :

 System.setProperty("java.net.useSystemProxies", "true");

To force Java to use system proxy while invoking the web service.

Java.net
  • 157
  • 2
  • 3
  • 13