title: How to bind webservice client to specified IP (network interface) with Apache CXF?
body: <p>My problems is: there is a one RHEL default server with 2 NIC configured:</p>
  
  <ul>
  <li>eth0 with IP 10.100.0.1</li>
  <li>eth1 with IP 10.100.100.1</li>
  </ul>
  
  <p>Also, there is jboss-6.0.0.20101110-CR1 installed on Red Hat, with an EAR deployed on this JBoss, which is a simple servlet listen to incoming data, and, after some processing, application forwards processed data to another web service on another host (for example 10.200.0.1), using Apache CXF framework (such a proxy with some of processing).</p>
  
  <p>Now, configuration issues.</p>
  
  <p>When JBoss need to listen incoming data on eth0, IP <strong>10.100.0.1</strong>, need to be run.sh with "-b" switch: run.sh -b 10.100.0.1, which is simple and clean.</p>
  
  <p>But I want to expand my issue: I want to enforce JBoss to call web service on other host with <strong>10.100.100.1</strong> as source IP for network traffic. How to do it? Is there any switch/property/whatever, which do the job?</p>
  
  <p>Summary:</p>
  
  <p>JBoss binds to eth0 for listen to incoming data on <strong>10.100.0.1</strong> and calls webservice with source IP <strong>10.100.100.1</strong> on <strong>10.200.0.1</strong>.</p>
  
  <p>Please help me, any ideas are really apreciated. I want to avoid any iptables/xinted redirect configuration :-)</p>
  
  <p>Regards,</p>
  
  <p>Mariusz</p>
  
  <p>PS. I've found another, similar issue (but native JBoss WS related...) in my company: one of our software providers has modified JBoss5's jbossws-native-core.jar to force this behavior by adding line:</p>
  
  <p><em>bootstrap.setOption("localAddress", new InetSocketAddress(localAddress, 0));</em></p>
  
  <p>to NettyClient.java, when localAddress is provided with -D switch and readed by getProperty() method in code. But also I want to avoid any of JBoss components modification...</p>