Hi Sergey
Regading my original question below, I have now successfully set proxy
server details programmatically by getting hold of the HTTPConduit of
the WebClient at runtime as follows:
HTTPConduit conduit =
(HTTPConduit)WebClient.getConfig(webClient).getConduit();
HTTPClientPolicy policy = conduit.getClient();
policy.setProxyServer("my.proxy.domain");
policy.setProxyServerPort(80);
However, this is not ideal - I really want to set conduit in my Spring
config
I can see in the docs how to associate a spring configured HTTPSConduit
with a JAX-WS client,
But how do I associate a HTTPConduit with a JAX-RS client in spring?
Where my WebClient is configured as a bean in spring as follows:
<bean id="myWebClient" class="org.apache.cxf.jaxrs.client.WebClient"
factory-method="create">
<constructor-arg type="java.lang.String"
value="${my.restful.service.url}" />
<constructor-arg ref="myWebClientProviders" />
</bean>
I don't see any obvious way of associating a HTTPConduit with the
endpoint
Thanks
Paul
-----Original Message-----
From: Paul Wilton [mailto:[email protected]]
Sent: 27 August 2009 11:26
To: [email protected]
Subject: using jax-rs WebClient through proxy server
Hi
I am using org.apache.cxf.jaxrs.client.WebClient to access a REST
service that sits behind a squid proxy server. The rest client WebClient
is running on Tomcat.
I have set JAVA_OPTS in the catalina startup script with my proxy server
settings:
-Dhttp.proxyHost=my.proxy.domain
-Dhttp.proxyPort=80
-Dhttp.nonProxyHosts=localhost,127.0.0.1
But the requests do not make it past the proxy server, and I just get
socket connection timeouts
Just to clarify,
My WebClient works fine when not behind a proxy server, and I can also
access the restful service using curl -x on the command line giving the
same proxy details.
My questions:
Does WebClient handle proxy servers ok ?
Is passing the proxy details to the JVM using java opts a valid
technique with WebClient ?
Is there some specific way of configuring WebClient to use proxy servers
?
Thanks for any help
Paul
This e-mail (and any attachments) is confidential and may contain
personal views which are not the views of the BBC unless specifically
stated. If you have received it in error, please delete it from your
system. Do not use, copy or disclose the information in any way nor act
in reliance on it and notify the sender immediately.
Please note that the BBC monitors e-mails sent or received. Further
communication will signify your consent to this
This e-mail has been sent by one of the following wholly-owned
subsidiaries of the BBC:
BBC Worldwide Limited, Registration Number: 1420028 England, Registered
Address: BBC Media Centre, 201 Wood Lane, London, W12 7TQ
BBC World News Limited, Registration Number: 04514407 England,
Registered Address: BBC Media Centre, 201 Wood Lane, London, W12 7TQ
BBC World Distribution Limited, Registration Number: 04514408,
Registered Address: BBC Media Centre, 201 Wood Lane, London, W12 7TQ