You are viewing a plain text version of this content. The canonical link for it is here.
Posted to java-dev@axis.apache.org by de...@apache.org on 2005/09/20 08:30:40 UTC

svn commit: r290374 - /webservices/axis2/trunk/java/modules/core/src/org/apache/axis2/transport/tcp/TCPServer.java

Author: deepal
Date: Mon Sep 19 23:30:34 2005
New Revision: 290374

URL: http://svn.apache.org/viewcvs?rev=290374&view=rev
Log:
modified target EPR in TCP server

Modified:
    webservices/axis2/trunk/java/modules/core/src/org/apache/axis2/transport/tcp/TCPServer.java

Modified: webservices/axis2/trunk/java/modules/core/src/org/apache/axis2/transport/tcp/TCPServer.java
URL: http://svn.apache.org/viewcvs/webservices/axis2/trunk/java/modules/core/src/org/apache/axis2/transport/tcp/TCPServer.java?rev=290374&r1=290373&r2=290374&view=diff
==============================================================================
--- webservices/axis2/trunk/java/modules/core/src/org/apache/axis2/transport/tcp/TCPServer.java (original)
+++ webservices/axis2/trunk/java/modules/core/src/org/apache/axis2/transport/tcp/TCPServer.java Mon Sep 19 23:30:34 2005
@@ -33,6 +33,8 @@
 import java.io.IOException;
 import java.net.ServerSocket;
 import java.net.Socket;
+import java.net.InetAddress;
+import java.net.UnknownHostException;
 
 /**
  * Class HTTPTransportReceiver
@@ -108,7 +110,13 @@
      * @see org.apache.axis2.transport.TransportListener#replyToEPR(java.lang.String)
      */
     public EndpointReference replyToEPR(String serviceName) throws AxisFault {
-        return new EndpointReference("tcp://127.0.0.1:" + (serversocket.getLocalPort()) +
+        String hostAddress;
+        try {
+            hostAddress = InetAddress.getLocalHost().getHostAddress();
+        } catch (UnknownHostException e) {
+            throw new AxisFault(e);
+        }
+        return new EndpointReference("tcp://"+ hostAddress + (serversocket.getLocalPort()) +
                 "/axis/services/" +
                 serviceName);
     }