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 10.100.0.1
      • eth1 with IP 10.100.100.1

       

      Also, there is jboss-6.0.0.20101110-CR1 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 10.200.0.1), using Apache CXF framework.

       

      Now, configuration issues.

      When JBoss need to listen incoming data on eth0, IP 10.100.0.1, need to be run.sh with "-b" switch: run.sh -b 10.100.0.1, 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 10.100.100.1 as source IP for network traffic. How to do it? Is there any switch/property/whatever, which do the job?

       

      Summary:

      JBoss binds to eth0 for listen to incoming data on 10.100.0.1 and calls webservice with source IP 10.100.100.1 on 10.200.0.1.

       

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

       

      Regards,

      Mariusz

       

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