Axis2
  1. Axis2
  2. AXIS2-3784

WSDL port address is not correctly generated for machines having multiple network interfaces

    Details

    • Type: Bug Bug
    • Status: Resolved
    • Priority: Major Major
    • Resolution: Fixed
    • Affects Version/s: 1.3, 1.4
    • Fix Version/s: 1.5.4, 1.6.0
    • Component/s: kernel
    • Labels:
      None
    • Environment:
      Windows XP Pro, Java 5, Tomcat 6, Axis2 1.4 (release)

      Description

      WSDL portAddress is filled with one of the machine's IP addresses. The code to get the IP address seems to be org.apache.axis2.transport.http.sever.HTTPUtils.getIpAddress() which always takes the first available network interface's ip address.

      For example http://localhost:8080/axis2/services/Version?wsdl returns a WSDL containing
      ...
      <wsdl:service name="Version">
      <wsdl:port name="VersionHttpSoap11Endpoint" binding="ns:VersionSoap11Binding">
      <soap:address location="http://10.20.125.14:8080/axis2/services/Version.VersionHttpSoap11Endpoint"/>
      </wsdl:port>
      <wsdl:port name="VersionHttpSoap12Endpoint" binding="ns:VersionSoap12Binding">
      <soap12:address location="http://10.20.125.14:8080/axis2/services/Version.VersionHttpSoap12Endpoint"/>
      </wsdl:port>
      <wsdl:port name="VersionHttpEndpoint" binding="ns:VersionHttpBinding">
      <http:address location="http://10.20.125.14:8080/axis2/services/Version.VersionHttpEndpoint"/>
      </wsdl:port>
      </wsdl:service>
      ...

      This may not work on machines which have vmvare installed, or machines having multiple network interfaces or just a laptop which has wireless and wired lan.

      I think the correct way is to use the hostName instead of the ipAddress in the WSDL port address, for example
      ...
      <wsdl:service name="Version">
      <wsdl:port name="VersionHttpSoap11Endpoint" binding="ns:VersionSoap11Binding">
      <soap:address location="http://myhostname.company.com:8080/axis2/services/Version.VersionHttpSoap11Endpoint"/>
      </wsdl:port>
      <wsdl:port name="VersionHttpSoap12Endpoint" binding="ns:VersionSoap12Binding">
      <soap12:address location="http://myhostname.company.com:8080/axis2/services/Version.VersionHttpSoap12Endpoint"/>
      </wsdl:port>
      <wsdl:port name="VersionHttpEndpoint" binding="ns:VersionHttpBinding">
      <http:address location="http://myhostname.company.com:8080/axis2/services/Version.VersionHttpEndpoint"/>
      </wsdl:port>
      </wsdl:service>
      ...

      Regards, Dietmar

      1. AXIS2-3784.patch
        5 kB
        Boris Milanov

        Activity

        Dietmar Gaertner created issue -
        Nandana Mihindukulasooriya made changes -
        Field Original Value New Value
        Resolution Fixed [ 1 ]
        Status Open [ 1 ] Resolved [ 5 ]
        Boris Milanov made changes -
        Attachment AXIS2-3784.patch [ 12411657 ]
        Boris Milanov made changes -
        Attachment AXIS2-3784.patch [ 12411657 ]
        Boris Milanov made changes -
        Attachment AXIS2-3784.patch [ 12415584 ]
        Andreas Veithen made changes -
        Resolution Fixed [ 1 ]
        Status Resolved [ 5 ] Reopened [ 4 ]
        Assignee Andreas Veithen [ veithen ]
        Andreas Veithen made changes -
        Status Reopened [ 4 ] Resolved [ 5 ]
        Fix Version/s 1.6 [ 12313622 ]
        Resolution Fixed [ 1 ]
        Andreas Veithen made changes -
        Fix Version/s 1.5.4 [ 12315568 ]

          People

          • Assignee:
            Andreas Veithen
            Reporter:
            Dietmar Gaertner
          • Votes:
            0 Vote for this issue
            Watchers:
            4 Start watching this issue

            Dates

            • Created:
              Updated:
              Resolved:

              Development