0 Replies Latest reply on Dec 22, 2010 3:30 AM by Mariusz Jedrzejewski

    How to bind webservice client to specified IP (network interface)?

    Mariusz Jedrzejewski Newbie

      As a new user of group, I want to say big "Hello" to all community.

      And I want to post a question, descripted below.


      So, problems is: there is a one RHEL default server with 2 NIC configured:

      • eth0 with IP
      • eth1 with IP


      Also, there is jboss- installed on Red Hat. There is 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, using Apache CXF framework.


      Now, configuration issues.

      When JBoss need to listen incoming data on eth0, IP, need to be run.sh with "-b" switch: run.sh -b, which is simple and clean.

      But I want to expand my issue: I want to enforce JBoss to call web service on other host with as source IP for network traffic. How to do it? Is there any switch/property/whatever, which do the job?



      JBoss binds to eth0 for listen to incoming data on and calls webservice with source IP on


      Please help me, any ideas are really apreciated. I want to avoid iptables configuration :-)





      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:


      bootstrap.setOption("localAddress", new InetSocketAddress(localAddress, 0));


      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...