axis-java-dev mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From dee...@apache.org
Subject svn commit: r523655 - in /webservices/axis2/trunk/java/modules/kernel: src/org/apache/axis2/context/ src/org/apache/axis2/transport/http/ src/org/apache/axis2/transport/http/server/ test/org/apache/axis2/engine/
Date Thu, 29 Mar 2007 09:41:03 GMT
Author: deepal
Date: Thu Mar 29 02:41:02 2007
New Revision: 523655

URL: http://svn.apache.org/viewvc?view=rev&rev=523655
Log:
fixing getMyEPR();
- I found very funny thing , when I add a Constant to MessageContext then MessageContextChangeText
fails 

Modified:
    webservices/axis2/trunk/java/modules/kernel/src/org/apache/axis2/context/MessageContext.java
    webservices/axis2/trunk/java/modules/kernel/src/org/apache/axis2/transport/http/HTTPWorker.java
    webservices/axis2/trunk/java/modules/kernel/src/org/apache/axis2/transport/http/server/AxisHttpService.java
    webservices/axis2/trunk/java/modules/kernel/src/org/apache/axis2/transport/http/server/DefaultHttpConnectionFactory.java
    webservices/axis2/trunk/java/modules/kernel/test/org/apache/axis2/engine/MessageContextChangeTest.java

Modified: webservices/axis2/trunk/java/modules/kernel/src/org/apache/axis2/context/MessageContext.java
URL: http://svn.apache.org/viewvc/webservices/axis2/trunk/java/modules/kernel/src/org/apache/axis2/context/MessageContext.java?view=diff&rev=523655&r1=523654&r2=523655
==============================================================================
--- webservices/axis2/trunk/java/modules/kernel/src/org/apache/axis2/context/MessageContext.java
(original)
+++ webservices/axis2/trunk/java/modules/kernel/src/org/apache/axis2/context/MessageContext.java
Thu Mar 29 02:41:02 2007
@@ -144,7 +144,7 @@
     public final static int OUT_FAULT_FLOW = 4;
 
     public static final String REMOTE_ADDR = "REMOTE_ADDR";
-
+    public static final String TRANSPORT_ADDR = "TRANSPORT_ADDR";
     public static final String TRANSPORT_HEADERS = "TRANSPORT_HEADERS";
 
 

Modified: webservices/axis2/trunk/java/modules/kernel/src/org/apache/axis2/transport/http/HTTPWorker.java
URL: http://svn.apache.org/viewvc/webservices/axis2/trunk/java/modules/kernel/src/org/apache/axis2/transport/http/HTTPWorker.java?view=diff&rev=523655&r1=523654&r2=523655
==============================================================================
--- webservices/axis2/trunk/java/modules/kernel/src/org/apache/axis2/transport/http/HTTPWorker.java
(original)
+++ webservices/axis2/trunk/java/modules/kernel/src/org/apache/axis2/transport/http/HTTPWorker.java
Thu Mar 29 02:41:02 2007
@@ -207,6 +207,10 @@
                 pi = RESTUtil.processXMLRequest(msgContext, inentity.getContent(),
                                                 outbuffer.getOutputStream(), contentType);
             } else {
+                String ip = (String)msgContext.getProperty(MessageContext.TRANSPORT_ADDR);
+                if(ip!=null){
+                    uri = ip + uri;
+                }
                 pi = HTTPTransportUtils.processHTTPPostRequest(msgContext, inentity.getContent(),
                                                                outbuffer.getOutputStream(),
                                                                contentType, soapAction, uri);

Modified: webservices/axis2/trunk/java/modules/kernel/src/org/apache/axis2/transport/http/server/AxisHttpService.java
URL: http://svn.apache.org/viewvc/webservices/axis2/trunk/java/modules/kernel/src/org/apache/axis2/transport/http/server/AxisHttpService.java?view=diff&rev=523655&r1=523654&r2=523655
==============================================================================
--- webservices/axis2/trunk/java/modules/kernel/src/org/apache/axis2/transport/http/server/AxisHttpService.java
(original)
+++ webservices/axis2/trunk/java/modules/kernel/src/org/apache/axis2/transport/http/server/AxisHttpService.java
Thu Mar 29 02:41:02 2007
@@ -189,10 +189,13 @@
             HttpInetConnection inetconn = (HttpInetConnection) conn;
             InetAddress address = inetconn.getRemoteAddress();
             this.msgContext.setProperty(MessageContext.REMOTE_ADDR, address.getHostAddress());
+
             if (LOG.isDebugEnabled()) {
                 LOG.debug("Remote address of the connection : " + address);
             }
         }
+        this.msgContext.setProperty(MessageContext.TRANSPORT_ADDR,
+                ((DefaultHttpConnectionFactory.Axis2HttpServerConnection)conn).getLocalIPAddress());
         super.handleRequest(conn, context);
     }
 

Modified: webservices/axis2/trunk/java/modules/kernel/src/org/apache/axis2/transport/http/server/DefaultHttpConnectionFactory.java
URL: http://svn.apache.org/viewvc/webservices/axis2/trunk/java/modules/kernel/src/org/apache/axis2/transport/http/server/DefaultHttpConnectionFactory.java?view=diff&rev=523655&r1=523654&r2=523655
==============================================================================
--- webservices/axis2/trunk/java/modules/kernel/src/org/apache/axis2/transport/http/server/DefaultHttpConnectionFactory.java
(original)
+++ webservices/axis2/trunk/java/modules/kernel/src/org/apache/axis2/transport/http/server/DefaultHttpConnectionFactory.java
Thu Mar 29 02:41:02 2007
@@ -59,6 +59,7 @@
         public Axis2HttpServerConnection() {
             super();
         }
+        //((InetAddress)socket.getLocalAddress()).getHostAddress()
 
         public String getRemoteIPAddress() {
             java.net.SocketAddress sa = socket.getRemoteSocketAddress();
@@ -69,13 +70,32 @@
             }
         }
 
+         public String getLocalIPAddress() {
+            java.net.SocketAddress sa = socket.getLocalSocketAddress();
+            if (sa instanceof java.net.InetSocketAddress) {
+                return ((java.net.InetSocketAddress) sa).getAddress().getHostAddress()
+                        + ":" + socket.getLocalPort();
+            } else {
+                return sa.toString();
+            }
+        }
+
         public String getRemoteHostName() {
             java.net.SocketAddress sa = socket.getRemoteSocketAddress();
             if (sa instanceof java.net.InetSocketAddress) {
                 return ((java.net.InetSocketAddress) sa).getHostName();
             } else {
-                return sa
-                        .toString(); // fail-safe and fall back to something which one can
use in place of the host name
+                return sa.toString();
+                // fail-safe and fall back to something which one can use in place of the
host name
+            }
+        }
+         public String getLocalHostName() {
+            java.net.SocketAddress sa = socket.getLocalSocketAddress();
+            if (sa instanceof java.net.InetSocketAddress) {
+                return ((java.net.InetSocketAddress) sa).getHostName();
+            } else {
+                return sa.toString();
+                // fail-safe and fall back to something which one can use in place of the
host name
             }
         }
     }

Modified: webservices/axis2/trunk/java/modules/kernel/test/org/apache/axis2/engine/MessageContextChangeTest.java
URL: http://svn.apache.org/viewvc/webservices/axis2/trunk/java/modules/kernel/test/org/apache/axis2/engine/MessageContextChangeTest.java?view=diff&rev=523655&r1=523654&r2=523655
==============================================================================
--- webservices/axis2/trunk/java/modules/kernel/test/org/apache/axis2/engine/MessageContextChangeTest.java
(original)
+++ webservices/axis2/trunk/java/modules/kernel/test/org/apache/axis2/engine/MessageContextChangeTest.java
Thu Mar 29 02:41:02 2007
@@ -38,6 +38,7 @@
             new FieldDescription("int", "OUT_FLOW"),
             new FieldDescription("int", "OUT_FAULT_FLOW"),
             new FieldDescription("java.lang.String", "REMOTE_ADDR"),
+            new FieldDescription("java.lang.String", "TRANSPORT_ADDR"),
             new FieldDescription("java.lang.String", "TRANSPORT_HEADERS"),
             new FieldDescription("org.apache.axiom.attachments.Attachments", "attachments"),
             new FieldDescription("java.lang.String", "TRANSPORT_OUT"),



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


Mime
View raw message