Details
-
Type:
Improvement
-
Status:
Resolved
-
Priority:
Major
-
Resolution: Fixed
-
Affects Version/s: 1.1-RC1
-
Fix Version/s: 1.2.5
-
Component/s: None
-
Labels:None
-
Environment:N/A
-
Number of attachments :
Description
Currently it seems that the only way to specify a proxy for an XFire client is by doing it programatically when creating the client:
MySoap client = stub.getMySoap();
Client http = ((XFireProxy) Proxy.getInvocationHandler(client)).getClient();
http.setProperty(CommonsHttpMessageSender.HTTP_PROXY_HOST, "localhost");
http.setProperty(CommonsHttpMessageSender.HTTP_PROXY_PORT, "8080");
This means that if you want to be able to transparently set a proxy you'll have to code some logic to check whether a property is set everywhere you create a client. A much more convenient way would be if the generated code from XFire took into account the standard Java environment properties for setting a proxy (as documented here: http://java.sun.com/j2se/1.5.0/docs/guide/net/properties.html). This would provide much convenience and flexibility in how to set whether or not to use an HTTP proxy as explained here: http://www.rgagnon.com/javadetails/java-0085.html.
I just upgraded from xfire-1.2.3 -> 1.2.4.
I have been using a proxy for debugging and performance analysis with jmeter.
I am using a jdk150_b6 and a tomcat 5.5.20
So far I have used the code above to configure the proxy but after the upgrade neither method seems to work.
The client always ignores any proxy settings
a) works with 1.2.3, broken with 1.2.4
MySoap client = stub.getMySoap();
Client http = ((XFireProxy) Proxy.getInvocationHandler(client)).getClient();
http.setProperty(CommonsHttpMessageSender.HTTP_PROXY_HOST, "localhost");
http.setProperty(CommonsHttpMessageSender.HTTP_PROXY_PORT, "8080");
b) did not work on any version (1.2.3, 1.2.4)
-Dhttp.proxyHost=localhost
-Dhttp.proxyPort=8081
-Dhttp.nonProxyHosts=
b) did not work on any version (1.2.3, 1.2.4)
-Dhttp.proxyHost=localhost
-Dhttp.proxyPort=8081