2

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

shuttsy
  • 1,585
  • 2
  • 19
  • 34
  • Sorry for asking the obvious, but *is* your webservice called on localhost or eg. a class C private network address such as 192.168.1.42? – Anders R. Bystrup Nov 29 '12 at 10:55
  • What is the exact host you are using in your code? Adding "localhost" to the list of nonProxy doesn't mean 127.0.0.x isn't going through the proxy. – Janoz Nov 29 '12 at 11:00
  • My web service is exposed through a domain name of "myDomain.co.uk". This is what I am using in the JaxWS bean definition in my app code or even in Junits and the web service calls are successful. – shuttsy Nov 29 '12 at 11:22
  • How do you know http.noProxyHosts is not working and the problem is not any other? Are you receiving the ws call in a remote server through the proxy? – aalku Sep 26 '13 at 11:22

0 Answers0