You are viewing a plain text version of this content. The canonical link for it is here.
Posted to axis-cvs@ws.apache.org by ch...@apache.org on 2006/01/20 10:02:13 UTC

svn commit: r370760 - in /webservices/axis2/trunk/java/modules: addressing/src/org/apache/axis2/handlers/addressing/ core/src/org/apache/axis2/ core/src/org/apache/axis2/context/ core/src/org/apache/axis2/engine/ core/src/org/apache/axis2/transport/http/

Author: chinthaka
Date: Fri Jan 20 01:01:48 2006
New Revision: 370760

URL: http://svn.apache.org/viewcvs?rev=370760&view=rev
Log:
Adding transport url to be picked up from the transport, so that it can be set as the replyTo of the response.

Modified:
    webservices/axis2/trunk/java/modules/addressing/src/org/apache/axis2/handlers/addressing/AddressingOutHandler.java
    webservices/axis2/trunk/java/modules/core/src/org/apache/axis2/Constants.java
    webservices/axis2/trunk/java/modules/core/src/org/apache/axis2/context/ServiceContext.java
    webservices/axis2/trunk/java/modules/core/src/org/apache/axis2/engine/InstanceDispatcher.java
    webservices/axis2/trunk/java/modules/core/src/org/apache/axis2/transport/http/AxisServlet.java
    webservices/axis2/trunk/java/modules/core/src/org/apache/axis2/transport/http/HTTPWorker.java

Modified: webservices/axis2/trunk/java/modules/addressing/src/org/apache/axis2/handlers/addressing/AddressingOutHandler.java
URL: http://svn.apache.org/viewcvs/webservices/axis2/trunk/java/modules/addressing/src/org/apache/axis2/handlers/addressing/AddressingOutHandler.java?rev=370760&r1=370759&r2=370760&view=diff
==============================================================================
--- webservices/axis2/trunk/java/modules/addressing/src/org/apache/axis2/handlers/addressing/AddressingOutHandler.java (original)
+++ webservices/axis2/trunk/java/modules/addressing/src/org/apache/axis2/handlers/addressing/AddressingOutHandler.java Fri Jan 20 01:01:48 2006
@@ -123,8 +123,8 @@
             epr = messageContextOptions.getReplyTo();
             if (epr == null) {//optional
 
-                if (msgContext.getServiceContext() != null && msgContext.getServiceContext().getMyEPR() != null) {
-                    epr = new EndpointReference(msgContext.getServiceContext().getMyEPR());
+                if (msgContext.getServiceContext() != null && msgContext.getServiceContext().getMyEPRAddress() != null) {
+                    epr = new EndpointReference(msgContext.getServiceContext().getMyEPRAddress());
                 } else {
                     // setting anonymous URI. Defaulting to Final.
                     String anonymousURI = Final.WSA_ANONYMOUS_URL;

Modified: webservices/axis2/trunk/java/modules/core/src/org/apache/axis2/Constants.java
URL: http://svn.apache.org/viewcvs/webservices/axis2/trunk/java/modules/core/src/org/apache/axis2/Constants.java?rev=370760&r1=370759&r2=370760&view=diff
==============================================================================
--- webservices/axis2/trunk/java/modules/core/src/org/apache/axis2/Constants.java (original)
+++ webservices/axis2/trunk/java/modules/core/src/org/apache/axis2/Constants.java Fri Jan 20 01:01:48 2006
@@ -212,5 +212,7 @@
         // this property once set to Boolean.TRUE will make the messages to skip Addressing Handler.
         // So you will not see Addressing Headers in the OUT path.
         public static final String DISABLE_ADDRESSING_FOR_OUT_MESSAGES = "disableAddressingForOutMessages";
+
+        public static final String TRANSPORT_IN_URL = "TransportInURL";
     }
 }

Modified: webservices/axis2/trunk/java/modules/core/src/org/apache/axis2/context/ServiceContext.java
URL: http://svn.apache.org/viewcvs/webservices/axis2/trunk/java/modules/core/src/org/apache/axis2/context/ServiceContext.java?rev=370760&r1=370759&r2=370760&view=diff
==============================================================================
--- webservices/axis2/trunk/java/modules/core/src/org/apache/axis2/context/ServiceContext.java (original)
+++ webservices/axis2/trunk/java/modules/core/src/org/apache/axis2/context/ServiceContext.java Fri Jan 20 01:01:48 2006
@@ -29,6 +29,8 @@
  */
 public class ServiceContext extends AbstractContext {
 
+    private String myEPRAddress;
+
     private transient AxisService axisService;
     private String serviceInstanceID;
     private ServiceGroupContext serviceGroupContext;
@@ -99,9 +101,11 @@
         this.replyTorefpars = replyTorefpars;
     }
 
-    public String getMyEPR() {
+    public String getMyEPRAddress() {
+        return myEPRAddress;
+    }
 
-        // TODO : Fix me Deepal
-        return null;  //To change body of created methods use File | Settings | File Templates.
+    public void setMyEPRAddress(String myEPRAddress) {
+        this.myEPRAddress = myEPRAddress;
     }
 }

Modified: webservices/axis2/trunk/java/modules/core/src/org/apache/axis2/engine/InstanceDispatcher.java
URL: http://svn.apache.org/viewcvs/webservices/axis2/trunk/java/modules/core/src/org/apache/axis2/engine/InstanceDispatcher.java?rev=370760&r1=370759&r2=370760&view=diff
==============================================================================
--- webservices/axis2/trunk/java/modules/core/src/org/apache/axis2/engine/InstanceDispatcher.java (original)
+++ webservices/axis2/trunk/java/modules/core/src/org/apache/axis2/engine/InstanceDispatcher.java Fri Jan 20 01:01:48 2006
@@ -38,17 +38,20 @@
 
 	private static final long serialVersionUID = -1928612412157492489L;
 
-	/**
+
+    /**
      * Post Condition : All the Contexts must be populated.
      *
      * @param msgContext
      * @throws org.apache.axis2.AxisFault
      */
     public void invoke(MessageContext msgContext) throws AxisFault {
+        ServiceContext serviceContext = msgContext.getServiceContext();
+
         if ((msgContext.getOperationContext() != null)
-                && (msgContext.getServiceContext() != null)) {
+                && (serviceContext != null)) {
             msgContext.setServiceGroupContextId(
-                    ((ServiceGroupContext) msgContext.getServiceContext().getParent()).getId());
+                    ((ServiceGroupContext) serviceContext.getParent()).getId());
 
             return;
         }
@@ -70,7 +73,7 @@
             // register operation context and message context
             axisOperation.registerOperationContext(msgContext, operationContext);
 
-            ServiceContext serviceContext = (ServiceContext) operationContext.getParent();
+            serviceContext = (ServiceContext) operationContext.getParent();
             ServiceGroupContext serviceGroupContext =
                     (ServiceGroupContext) serviceContext.getParent();
 
@@ -81,15 +84,21 @@
             operationContext = new OperationContext(axisOperation);
 
             axisOperation.registerOperationContext(msgContext, operationContext);
-            if (msgContext.getServiceContext() != null) {
+            if (serviceContext != null) {
                 // no need to added to configuration conetxt , since we are happy in
                 //  storing in session context
-                operationContext.setParent(msgContext.getServiceContext());
+                operationContext.setParent(serviceContext);
             } else {
                 // fill the service group context and service context info
                 msgContext.getConfigurationContext().fillServiceContextAndServiceGroupContext(
                         msgContext);
             }
+        }
+
+
+        String transportURL = (String) msgContext.getProperty(Constants.Configuration.TRANSPORT_IN_URL);
+        if (serviceContext != null && transportURL != null) {
+           serviceContext.setMyEPRAddress(transportURL);
         }
     }
 

Modified: webservices/axis2/trunk/java/modules/core/src/org/apache/axis2/transport/http/AxisServlet.java
URL: http://svn.apache.org/viewcvs/webservices/axis2/trunk/java/modules/core/src/org/apache/axis2/transport/http/AxisServlet.java?rev=370760&r1=370759&r2=370760&view=diff
==============================================================================
--- webservices/axis2/trunk/java/modules/core/src/org/apache/axis2/transport/http/AxisServlet.java (original)
+++ webservices/axis2/trunk/java/modules/core/src/org/apache/axis2/transport/http/AxisServlet.java Fri Jan 20 01:01:48 2006
@@ -68,6 +68,7 @@
         msgContext.setProperty(MessageContext.TRANSPORT_HEADERS,
                 getTransportHeaders(httpServletRequest));
         msgContext.setProperty(SESSION_ID, httpServletRequest.getSession().getId());
+        msgContext.setProperty(Constants.Configuration.TRANSPORT_IN_URL, httpServletRequest.getRequestURL());
 
         return msgContext;
     }

Modified: webservices/axis2/trunk/java/modules/core/src/org/apache/axis2/transport/http/HTTPWorker.java
URL: http://svn.apache.org/viewcvs/webservices/axis2/trunk/java/modules/core/src/org/apache/axis2/transport/http/HTTPWorker.java?rev=370760&r1=370759&r2=370760&view=diff
==============================================================================
--- webservices/axis2/trunk/java/modules/core/src/org/apache/axis2/transport/http/HTTPWorker.java (original)
+++ webservices/axis2/trunk/java/modules/core/src/org/apache/axis2/transport/http/HTTPWorker.java Fri Jan 20 01:01:48 2006
@@ -118,6 +118,8 @@
             // This is way to provide access to the transport information to the transport Sender
             msgContext.setProperty(Constants.OUT_TRANSPORT_INFO,
                     new SimpleHTTPOutTransportInfo(response));
+            msgContext.setProperty(Constants.Configuration.TRANSPORT_IN_URL, request.getRequestLine().getUri());
+
 
             String soapAction = null;