You are viewing a plain text version of this content. The canonical link for it is here.
Posted to users@cxf.apache.org by jvh003 <jv...@hotmail.com> on 2016/06/28 14:35:34 UTC

Howto set local inet address for CXF client

Hello,
I have a CXF client running on a Linux platform that has 2 network
interfaces.
Currently my client requests are sent out on the 1st interface, but I need
them to be sent out on the 2nd one.
How can I set the local address that the client will use when creating
client connections to the far end web-service?

I was reading here
http://cxf.apache.org/docs/client-http-transport-including-ssl-support.html
about now to change the connection timeout value.
I am looking for something similar to set the local InetAddress for the
client.

Thanks



--
View this message in context: http://cxf.547215.n5.nabble.com/Howto-set-local-inet-address-for-CXF-client-tp5769787.html
Sent from the cxf-user mailing list archive at Nabble.com.

RE: Howto set local inet address for CXF client

Posted by jvh003 <jv...@hotmail.com>.
No luck with this.
I'm running in a WAS container that uses Axis2 to implement the client
Service object.
The AsyncHTTPConduit or the HTTPConduit don't seem to be used in this case.

Any other ideas?



--
View this message in context: http://cxf.547215.n5.nabble.com/Howto-set-local-inet-address-for-CXF-client-tp5769787p5770520.html
Sent from the cxf-user mailing list archive at Nabble.com.

RE: Howto set local inet address for CXF client

Posted by jvh003 <jv...@hotmail.com>.
Thanks for the suggestion, I'll give it a try.



--
View this message in context: http://cxf.547215.n5.nabble.com/Howto-set-local-inet-address-for-CXF-client-tp5769787p5770177.html
Sent from the cxf-user mailing list archive at Nabble.com.

RE: Howto set local inet address for CXF client

Posted by Andrei Shakirin <as...@talend.com>.
Hi,

I don't see easy way to do it.
URLConnection doesn't support setting network interface directly.

The option is to override AsyncHTTPConduit.setupConnection() method and set your interface address using RequestConfig.Builder.setLocalAddress() (http://hc.apache.org/httpcomponents-client-ga/httpclient/apidocs/org/apache/http/client/config/RequestConfig.Builder.html#setLocalAddress(java.net.InetAddress) )

After that, configure and use overriding conduit.

Perhaps there is easier way to achieve this, but I am not aware about it.

Regards,
Andrei.


> -----Original Message-----
> From: jvh003 [mailto:jvh003@hotmail.com]
> Sent: Dienstag, 28. Juni 2016 16:36
> To: users@cxf.apache.org
> Subject: Howto set local inet address for CXF client
> 
> Hello,
> I have a CXF client running on a Linux platform that has 2 network interfaces.
> Currently my client requests are sent out on the 1st interface, but I need them
> to be sent out on the 2nd one.
> How can I set the local address that the client will use when creating client
> connections to the far end web-service?
> 
> I was reading here
> http://cxf.apache.org/docs/client-http-transport-including-ssl-support.html
> about now to change the connection timeout value.
> I am looking for something similar to set the local InetAddress for the client.
> 
> Thanks
> 
> 
> 
> --
> View this message in context: http://cxf.547215.n5.nabble.com/Howto-set-
> local-inet-address-for-CXF-client-tp5769787.html
> Sent from the cxf-user mailing list archive at Nabble.com.