I have an application which uses Spring to talk to some web services via the JaxWsPortProxyFactoryBean class. All works fine.
Another part of my application needs to talk to the internet (for some RSS feeds), so I need to configure my proxy settings. I do this by adding the following system properties to my Tomcat server:
-Dhttp.proxyHost=webproxy -Dhttp.proxyPort=80 -Dhttp.proxyUser=myUser -Dhttp.proxyPassword=myPass
My RSS feeds now work (so proxy settings all correct), but my web service calls fail with the following:
org.springframework.remoting.RemoteAccessException: Could not access remote service at [null]; nested exception is com.sun.xml.internal.ws.client.ClientTransportException: The server sent HTTP status code 403: Forbidden
at org.springframework.remoting.jaxws.JaxWsPortClientInterceptor.doInvoke(JaxWsPortClientInterceptor.java:504)
at org.springframework.remoting.jaxws.JaxWsPortClientInterceptor.invoke(JaxWsPortClientInterceptor.java:481)
at org.springframework.aop.framework.ReflectiveMethodInvocation.proceed(ReflectiveMethodInvocation.java:172)
at org.springframework.aop.framework.JdkDynamicAopProxy.invoke(JdkDynamicAopProxy.java:202)
Looks like my app is trying to go through the proxy for the webservice calls (which are to local systems), so tried to set the nonProxyHosts property for the webservice domain (note - seems to be some confusion with a typo in the docs about this - hence the 2 values):
-Dhttp.noProxyHosts="localhost|myDomain.co.uk" -Dhttp.nonProxyHosts="localhost|myDomain.co.uk"
However, I still get the 403 Forbidden exception on my web service calls.
Any suggestions as I'm a bit stumped as to why the http.noProxyHosts/.nonProxyHosts doesn't seem to get applied?
FYI - am using Spring 3.1.0.RELEASE and Tomcat 6.0.32