cxf-dev mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From Guillaume Sauthier <>
Subject CXF and HTTP proxy properties
Date Wed, 13 Oct 2010 13:34:27 GMT
Hi team

I've found plenty of examples over the internet explaining how to setup 
an HTTP proxy (using Spring or the API).
This is always done on a per-service basis.
I was wondering why the http.proxy* System properties were not used for 
supporting this ?

In my use case (the JOnAS application server), I have fileds annotated 
with @WebServiceRef (plus some standard XML descriptors). The job of the 
AS is to prepare the instances (port or services) that will be injected 
into theses fields. I was thinking that I could configure the CXF Client 
object in this phase.

I was hoping that I could take the proxy System properties, extract 
required values from them and apply them on an HTTPClientPolicy for the 
HTTPConduit (no Spring Configuration here, remember the Java EE saint 
graal of portability between different providers), but I found that I 
may be blindly configuring a port to use the system proxy without 
knowing if the real endpoint address required a proxy or not.
For example, imagine an environment were system proxy is required and 
configured to access external world, but the user wants to use a WS on 
localhost: if I configure it to use the proxy, it will fail during the call.

I thought to use the nonProxyHost system property to conditionally apply 
the proxy config but my use case required me to apply the config at the 
very last moment (when we know the exact endpoint URL), requiring me to 
wrap and proxy a lot of CXF classes. Definitely not an ideal solution :) 
Or maybe I could implement this directly inside CXF...

So, I come here to discuss this point.
Could it be possible (currently I'm not sure, but maybe as an evolution) 
to provide the proxy configuration as some kind of global variable for 
all the services (maybe as a per-bus configuration), but with support 
for nonProxyHost (or the like) ?



  • Unnamed multipart/mixed (inline, None, 0 bytes)
View raw message