synapse-dev mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From ind...@apache.org
Subject svn commit: r605805 - in /webservices/synapse/trunk/java/modules/core/src/main/java/org/apache/synapse: SynapseConstants.java mediators/GetPropertyFunction.java
Date Thu, 20 Dec 2007 04:24:49 GMT
Author: indika
Date: Wed Dec 19 20:24:47 2007
New Revision: 605805

URL: http://svn.apache.org/viewvc?rev=605805&view=rev
Log:
committing patch of Andreas Veithen - to allow access the operation name and NS through the
get-property() function ... This will be more easier and convenience for getting those information
even it can get through request payload or WSA-Action (only operation name).

Modified:
    webservices/synapse/trunk/java/modules/core/src/main/java/org/apache/synapse/SynapseConstants.java
    webservices/synapse/trunk/java/modules/core/src/main/java/org/apache/synapse/mediators/GetPropertyFunction.java

Modified: webservices/synapse/trunk/java/modules/core/src/main/java/org/apache/synapse/SynapseConstants.java
URL: http://svn.apache.org/viewvc/webservices/synapse/trunk/java/modules/core/src/main/java/org/apache/synapse/SynapseConstants.java?rev=605805&r1=605804&r2=605805&view=diff
==============================================================================
--- webservices/synapse/trunk/java/modules/core/src/main/java/org/apache/synapse/SynapseConstants.java
(original)
+++ webservices/synapse/trunk/java/modules/core/src/main/java/org/apache/synapse/SynapseConstants.java
Wed Dec 19 20:24:47 2007
@@ -68,6 +68,10 @@
     public static final String HEADER_MESSAGE_ID = "MessageID";
     /** Message format: pox, soap11, soap12 */
     public static final String PROPERTY_MESSAGE_FORMAT = "MESSAGE_FORMAT";
+    /** WSDL operation name **/
+    public static final String PROPERTY_OPERATION_NAME = "OperationName";
+    /** WSDL operation namespace **/
+    public static final String PROPERTY_OPERATION_NAMESPACE = "OperationNamespace";
     /** System time in milliseconds - the offset from epoch (i.e. System.currentTimeMillis)
*/
     public static final String SYSTEM_TIME = "SYSTEM_TIME";
     /** System date */

Modified: webservices/synapse/trunk/java/modules/core/src/main/java/org/apache/synapse/mediators/GetPropertyFunction.java
URL: http://svn.apache.org/viewvc/webservices/synapse/trunk/java/modules/core/src/main/java/org/apache/synapse/mediators/GetPropertyFunction.java?rev=605805&r1=605804&r2=605805&view=diff
==============================================================================
--- webservices/synapse/trunk/java/modules/core/src/main/java/org/apache/synapse/mediators/GetPropertyFunction.java
(original)
+++ webservices/synapse/trunk/java/modules/core/src/main/java/org/apache/synapse/mediators/GetPropertyFunction.java
Wed Dec 19 20:24:47 2007
@@ -20,6 +20,7 @@
 package org.apache.synapse.mediators;
 
 import org.apache.axis2.addressing.EndpointReference;
+import org.apache.axis2.description.AxisOperation;
 import org.apache.commons.logging.Log;
 import org.apache.commons.logging.LogFactory;
 import org.apache.synapse.SynapseConstants;
@@ -220,6 +221,19 @@
                     return SynapseConstants.FORMAT_SOAP11;
                 else
                     return SynapseConstants.FORMAT_SOAP12;
+            } else if (SynapseConstants.PROPERTY_OPERATION_NAME.equals(key) ||
+                       SynapseConstants.PROPERTY_OPERATION_NAMESPACE.equals(key)) {
+                if (synCtx instanceof Axis2MessageContext) {
+                    AxisOperation axisOperation
+                        = ((Axis2MessageContext)synCtx).getAxis2MessageContext().getAxisOperation();
+                    if (axisOperation != null) {
+                        if (SynapseConstants.PROPERTY_OPERATION_NAMESPACE.equals(key)) {
+                            return axisOperation.getName().getNamespaceURI();
+                        } else {
+                            return axisOperation.getName().getLocalPart();
+                        }
+                    }
+                }
             } else {
                 Object result = synCtx.getProperty(key);
                 if (result != null) {



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


Mime
View raw message