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 2007/04/24 11:29:10 UTC

svn commit: r531848 - /webservices/axis2/branches/java/1_2/modules/kernel/src/org/apache/axis2/transport/http/SimpleHTTPServer.java

Author: deepal
Date: Tue Apr 24 02:29:09 2007
New Revision: 531848

URL: http://svn.apache.org/viewvc?view=rev&rev=531848
Log:
fixing issue AXIS2-2581
 - Michele Mazzucco  please make sure I have done the right thing

Modified:
    webservices/axis2/branches/java/1_2/modules/kernel/src/org/apache/axis2/transport/http/SimpleHTTPServer.java

Modified: webservices/axis2/branches/java/1_2/modules/kernel/src/org/apache/axis2/transport/http/SimpleHTTPServer.java
URL: http://svn.apache.org/viewvc/webservices/axis2/branches/java/1_2/modules/kernel/src/org/apache/axis2/transport/http/SimpleHTTPServer.java?view=diff&rev=531848&r1=531847&r2=531848
==============================================================================
--- webservices/axis2/branches/java/1_2/modules/kernel/src/org/apache/axis2/transport/http/SimpleHTTPServer.java (original)
+++ webservices/axis2/branches/java/1_2/modules/kernel/src/org/apache/axis2/transport/http/SimpleHTTPServer.java Tue Apr 24 02:29:09 2007
@@ -56,6 +56,7 @@
      * Embedded commons http core based server
      */
     SimpleHttpServer embedded = null;
+    private String localAddress;
     int port = -1;
 
     public static int DEFAULT_PORT = 8080;
@@ -257,21 +258,25 @@
             }
         }
         //if the host address is not present
-        String localAddress;
+        String ipAddress;
         if (ip != null) {
-            localAddress = ip;
+            ipAddress = ip;
         } else {
             try {
-                localAddress = HttpUtils.getIpAddress();
+                if(localAddress==null){
+                    localAddress = HttpUtils.getIpAddress();
+                }
                 if (localAddress == null) {
-                    localAddress = "127.0.0.1";
+                    ipAddress = "127.0.0.1";
+                } else {
+                    ipAddress = localAddress;
                 }
             } catch (SocketException e) {
                 throw AxisFault.makeFault(e);
             }
         }
         if (embedded != null) {
-            return new EndpointReference[]{new EndpointReference("http://" + localAddress + ":" +
+            return new EndpointReference[]{new EndpointReference("http://" + ipAddress + ":" +
                                                                  (embedded.getPort())
                                                                  + "/" + configurationContext.getServiceContextPath() + "/" + serviceName)};
         } else {



---------------------------------------------------------------------
To unsubscribe, e-mail: axis-cvs-unsubscribe@ws.apache.org
For additional commands, e-mail: axis-cvs-help@ws.apache.org