axis-java-dev mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From chinth...@apache.org
Subject svn commit: r387740 - in /webservices/axis2/trunk/java: etc/project.properties modules/addressing/src/org/apache/axis2/handlers/addressing/AddressingOutHandler.java
Date Wed, 22 Mar 2006 05:54:26 GMT
Author: chinthaka
Date: Tue Mar 21 21:54:24 2006
New Revision: 387740

URL: http://svn.apache.org/viewcvs?rev=387740&view=rev
Log:
Moving to proper snapshots of policy and axiom
fixing addressing out handler bug of sharing the same var for sync issues

Modified:
    webservices/axis2/trunk/java/etc/project.properties
    webservices/axis2/trunk/java/modules/addressing/src/org/apache/axis2/handlers/addressing/AddressingOutHandler.java

Modified: webservices/axis2/trunk/java/etc/project.properties
URL: http://svn.apache.org/viewcvs/webservices/axis2/trunk/java/etc/project.properties?rev=387740&r1=387739&r2=387740&view=diff
==============================================================================
--- webservices/axis2/trunk/java/etc/project.properties (original)
+++ webservices/axis2/trunk/java/etc/project.properties Tue Mar 21 21:54:24 2006
@@ -79,7 +79,7 @@
 #for JAM
 annogen.version=0.1.0
 ant.version=1.6.5
-axiom.version=1.0-SNAPSHOT
+axiom.version=SNAPSHOT
 axis.wsdl4j.version=1.2
 backport_util_concurrent.version=2.0_01_pd
 bcprov.version=jdk13-131
@@ -103,7 +103,7 @@
 log4j.version=1.2.13
 maven.itest.plugin.version=1.0
 opensaml.version=1.0.1
-policy.version=0.92-SNAPSHOT
+policy.version=SNAPSHOT
 stax.api.version=1.0
 stax.impl.groupid=woodstox
 stax.impl.artifactid=wstx

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=387740&r1=387739&r2=387740&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
Tue Mar 21 21:54:24 2006
@@ -26,16 +26,8 @@
 import org.apache.axis2.context.ServiceContext;
 import org.apache.commons.logging.Log;
 import org.apache.commons.logging.LogFactory;
-import org.apache.ws.commons.om.OMAbstractFactory;
-import org.apache.ws.commons.om.OMAttribute;
-import org.apache.ws.commons.om.OMElement;
-import org.apache.ws.commons.om.OMNamespace;
-import org.apache.ws.commons.om.OMNode;
-import org.apache.ws.commons.soap.SOAPEnvelope;
-import org.apache.ws.commons.soap.SOAPFactory;
-import org.apache.ws.commons.soap.SOAPFault;
-import org.apache.ws.commons.soap.SOAPHeader;
-import org.apache.ws.commons.soap.SOAPHeaderBlock;
+import org.apache.ws.commons.om.*;
+import org.apache.ws.commons.soap.*;
 import org.apache.wsdl.WSDLConstants;
 
 import javax.xml.namespace.QName;
@@ -49,12 +41,10 @@
 
     private Log log = LogFactory.getLog(getClass());
 
-    protected OMNamespace addressingNamespaceObject;
-
-    private MessageContext msgCtxt;
-
     public void invoke(MessageContext msgContext) throws AxisFault {
 
+        OMNamespace addressingNamespaceObject;
+
         // it should be able to disable addressing by some one.
         Boolean
                 property = (Boolean) msgContext.getProperty(Constants.Configuration.DISABLE_ADDRESSING_FOR_OUT_MESSAGES);
@@ -70,7 +60,6 @@
             return;
         }
 
-        this.msgCtxt = msgContext;
 
         Object addressingVersionFromCurrentMsgCtxt = msgContext.getProperty(WS_ADDRESSING_VERSION);
         if (addressingVersionFromCurrentMsgCtxt != null) {
@@ -101,6 +90,8 @@
         Options messageContextOptions = msgContext.getOptions();
         SOAPEnvelope envelope = msgContext.getEnvelope();
         SOAPHeader soapHeader = envelope.getHeader();
+
+        // if there is no soap header in the envelope being processed, add one.
         if (soapHeader == null) {
             SOAPFactory soapFac = msgContext.isSOAP11() ? OMAbstractFactory.getSOAP11Factory()
: OMAbstractFactory.getSOAP12Factory();
             soapHeader = soapFac.createSOAPHeader(envelope);
@@ -112,34 +103,32 @@
         // define that in the Header itself.
         envelope.declareNamespace(addressingNamespaceObject);
 
-        EndpointReference epr;
-
         // processing WSA To
-        processToEPR(messageContextOptions, envelope);
+        processToEPR(messageContextOptions, envelope, addressingNamespaceObject);
 
         // processing WSA replyTo
-        processReplyTo(envelope, messageContextOptions, msgContext);
+        processReplyTo(envelope, messageContextOptions, msgContext, addressingNamespaceObject);
 
         // processing WSA From
-        processFromEPR(messageContextOptions, envelope);
+        processFromEPR(messageContextOptions, envelope, addressingNamespaceObject);
 
         // processing WSA FaultTo
-        processFaultToEPR(messageContextOptions, envelope);
+        processFaultToEPR(messageContextOptions, envelope, addressingNamespaceObject);
 
         String messageID = messageContextOptions.getMessageId();
         if (messageID != null && !isAddressingHeaderAlreadyAvailable(WSA_MESSAGE_ID,
envelope,
                 addressingNamespaceObject)) {//optional
-            processStringInfo(messageID, WSA_MESSAGE_ID, envelope);
+            processStringInfo(messageID, WSA_MESSAGE_ID, envelope, addressingNamespaceObject);
         }
 
         // processing WSA Action
-        processWSAAction(messageContextOptions, envelope);
+        processWSAAction(messageContextOptions, envelope, msgContext, addressingNamespaceObject);
 
         // processing WSA RelatesTo
-        processRelatesTo(envelope, messageContextOptions);
+        processRelatesTo(envelope, messageContextOptions, addressingNamespaceObject);
 
         // process fault headers, if present
-        processFaultsInfoIfPresent(envelope, msgContext);
+        processFaultsInfoIfPresent(envelope, msgContext, addressingNamespaceObject);
 
         // We are done, cleanup the references
         addressingNamespaceObject = null;
@@ -147,18 +136,19 @@
 
     }
 
-    private void processWSAAction(Options messageContextOptions, SOAPEnvelope envelope) {
+    private void processWSAAction(Options messageContextOptions, SOAPEnvelope envelope,
+                                  MessageContext msgCtxt, OMNamespace addressingNamespaceObject)
{
         if (msgCtxt.isProcessingFault()) {
-            processStringInfo(Final.WSA_FAULT_ACTION, WSA_ACTION, envelope);
+            processStringInfo(Final.WSA_FAULT_ACTION, WSA_ACTION, envelope, addressingNamespaceObject);
         }
         String action = messageContextOptions.getAction();
         if (action != null && !isAddressingHeaderAlreadyAvailable(WSA_ACTION, envelope,
                 addressingNamespaceObject)) {
-            processStringInfo(action, WSA_ACTION, envelope);
+            processStringInfo(action, WSA_ACTION, envelope, addressingNamespaceObject);
         }
     }
 
-    private void processFaultsInfoIfPresent(SOAPEnvelope envelope, MessageContext msgContext)
{
+    private void processFaultsInfoIfPresent(SOAPEnvelope envelope, MessageContext msgContext,
OMNamespace addressingNamespaceObject) {
         Map faultInfo = (Map) msgContext.getProperty(Constants.FAULT_INFORMATION_FOR_HEADERS);
         if (faultInfo != null) {
             String faultyHeaderQName = (String) faultInfo.get(Final.FAULT_HEADER_PROB_HEADER_QNAME);
@@ -186,7 +176,7 @@
         }
     }
 
-    private void processRelatesTo(SOAPEnvelope envelope, Options messageContextOptions) {
+    private void processRelatesTo(SOAPEnvelope envelope, Options messageContextOptions, OMNamespace
addressingNamespaceObject) {
         if (!isAddressingHeaderAlreadyAvailable(WSA_RELATES_TO, envelope, addressingNamespaceObject))
         {
             RelatesTo relatesTo = messageContextOptions.getRelatesTo();
@@ -196,7 +186,7 @@
                 relatesToHeader =
                         processStringInfo(relatesTo.getValue(),
                                 WSA_RELATES_TO,
-                                envelope);
+                                envelope, addressingNamespaceObject);
             }
 
             if (relatesToHeader != null)
@@ -212,23 +202,23 @@
         }
     }
 
-    private void processFaultToEPR(Options messageContextOptions, SOAPEnvelope envelope)
{
+    private void processFaultToEPR(Options messageContextOptions, SOAPEnvelope envelope,
OMNamespace addressingNamespaceObject) {
         EndpointReference epr;
         epr = messageContextOptions.getFaultTo();
         if (epr != null) {//optional
-            addToSOAPHeader(epr, AddressingConstants.WSA_FAULT_TO, envelope);
+            addToSOAPHeader(epr, AddressingConstants.WSA_FAULT_TO, envelope, addressingNamespaceObject);
         }
     }
 
-    private void processFromEPR(Options messageContextOptions, SOAPEnvelope envelope) {
+    private void processFromEPR(Options messageContextOptions, SOAPEnvelope envelope, OMNamespace
addressingNamespaceObject) {
         EndpointReference epr;
         epr = messageContextOptions.getFrom();
         if (epr != null) {//optional
-            addToSOAPHeader(epr, AddressingConstants.WSA_FROM, envelope);
+            addToSOAPHeader(epr, AddressingConstants.WSA_FROM, envelope, addressingNamespaceObject);
         }
     }
 
-    private void processReplyTo(SOAPEnvelope envelope, Options messageContextOptions, MessageContext
msgContext) {
+    private void processReplyTo(SOAPEnvelope envelope, Options messageContextOptions, MessageContext
msgContext, OMNamespace addressingNamespaceObject) {
         EndpointReference epr;
         if (!isAddressingHeaderAlreadyAvailable(WSA_REPLY_TO, envelope, addressingNamespaceObject))
         {
@@ -252,11 +242,11 @@
                     epr.setAddress(anonymousURI);
                 }
             }
-            addToSOAPHeader(epr, AddressingConstants.WSA_REPLY_TO, envelope);
+            addToSOAPHeader(epr, AddressingConstants.WSA_REPLY_TO, envelope, addressingNamespaceObject);
         }
     }
 
-    private void processToEPR(Options messageContextOptions, SOAPEnvelope envelope) throws
AxisFault {
+    private void processToEPR(Options messageContextOptions, SOAPEnvelope envelope, OMNamespace
addressingNamespaceObject) {
         EndpointReference epr = messageContextOptions.getTo();
         if (epr != null && !isAddressingHeaderAlreadyAvailable(WSA_TO, envelope,
addressingNamespaceObject))
         {
@@ -280,14 +270,14 @@
                 SOAPHeaderBlock toHeaderBlock = envelope.getHeader().addHeaderBlock(WSA_TO,
addressingNamespaceObject);
                 toHeaderBlock.setText(address);
             }
-            processToEPRReferenceInformation(referenceParameters, envelope.getHeader());
+            processToEPRReferenceInformation(referenceParameters, envelope.getHeader(),addressingNamespaceObject);
         }
     }
 
 
     private OMElement processStringInfo(String value,
                                         String type,
-                                        SOAPEnvelope soapEnvelope) {
+                                        SOAPEnvelope soapEnvelope, OMNamespace addressingNamespaceObject)
{
         if (!"".equals(value) && value != null) {
             SOAPHeaderBlock soapHeaderBlock =
                     soapEnvelope.getHeader().addHeaderBlock(type, addressingNamespaceObject);
@@ -300,7 +290,7 @@
 
     protected void addToSOAPHeader(EndpointReference epr,
                                    String type,
-                                   SOAPEnvelope envelope) {
+                                   SOAPEnvelope envelope, OMNamespace addressingNamespaceObject)
{
         if (epr == null || isAddressingHeaderAlreadyAvailable(type, envelope, addressingNamespaceObject))
         {
             return;
@@ -383,7 +373,7 @@
      *
      * @param referenceInformation
      */
-    private void processToEPRReferenceInformation(Map referenceInformation, OMElement parent)
{
+    private void processToEPRReferenceInformation(Map referenceInformation, OMElement parent,
OMNamespace addressingNamespaceObject) {
 
         boolean processingWSAFinal = Final.WSA_NAMESPACE.equals(addressingNamespace);
         if (referenceInformation != null && parent != null) {



Mime
View raw message