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 da...@apache.org on 2007/01/05 13:36:50 UTC

svn commit: r493016 - in /webservices/axis2/trunk/java/modules: addressing/src/org/apache/axis2/handlers/addressing/ addressing/test-resources/valid-messages/final/ addressing/test-resources/valid-messages/submission/ addressing/test/org/apache/axis2/h...

Author: davidillsley
Date: Fri Jan  5 04:36:50 2007
New Revision: 493016

URL: http://svn.apache.org/viewvc?view=rev&rev=493016
Log:
Add support for wsa:RelatesTo extensibility attributes

Modified:
    webservices/axis2/trunk/java/modules/addressing/src/org/apache/axis2/handlers/addressing/AddressingInHandler.java
    webservices/axis2/trunk/java/modules/addressing/src/org/apache/axis2/handlers/addressing/AddressingOutHandler.java
    webservices/axis2/trunk/java/modules/addressing/test-resources/valid-messages/final/soapmessage.xml
    webservices/axis2/trunk/java/modules/addressing/test-resources/valid-messages/submission/soapmessage.xml
    webservices/axis2/trunk/java/modules/addressing/test/org/apache/axis2/handlers/addressing/AddressingInHandlerTestBase.java
    webservices/axis2/trunk/java/modules/kernel/src/org/apache/axis2/addressing/RelatesTo.java

Modified: webservices/axis2/trunk/java/modules/addressing/src/org/apache/axis2/handlers/addressing/AddressingInHandler.java
URL: http://svn.apache.org/viewvc/webservices/axis2/trunk/java/modules/addressing/src/org/apache/axis2/handlers/addressing/AddressingInHandler.java?view=diff&rev=493016&r1=493015&r2=493016
==============================================================================
--- webservices/axis2/trunk/java/modules/addressing/src/org/apache/axis2/handlers/addressing/AddressingInHandler.java (original)
+++ webservices/axis2/trunk/java/modules/addressing/src/org/apache/axis2/handlers/addressing/AddressingInHandler.java Fri Jan  5 04:36:50 2007
@@ -226,6 +226,10 @@
         }
         
         RelatesTo relatesTo = new RelatesTo(address, relationshipTypeString);
+        
+        ArrayList attributes = extractAttributesFromSOAPHeaderBlock(soapHeaderBlock);
+        relatesTo.setExtensibilityAttributes(attributes);
+        
         messageContextOptions.addRelatesTo(relatesTo);
         
         // Completed processing of this header

Modified: webservices/axis2/trunk/java/modules/addressing/src/org/apache/axis2/handlers/addressing/AddressingOutHandler.java
URL: http://svn.apache.org/viewvc/webservices/axis2/trunk/java/modules/addressing/src/org/apache/axis2/handlers/addressing/AddressingOutHandler.java?view=diff&rev=493016&r1=493015&r2=493016
==============================================================================
--- 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  5 04:36:50 2007
@@ -242,6 +242,14 @@
                         relatesToHeader.addAttribute(WSA_RELATES_TO_RELATIONSHIP_TYPE,
                                 relationshipType,
                                 null);
+                        
+                        if(relatesTo[i].getExtensibilityAttributes() != null){
+                            Iterator attributes = relatesTo[i].getExtensibilityAttributes().iterator();
+                            while(attributes.hasNext()){
+                                OMAttribute oma = (OMAttribute)attributes.next();
+                                AttributeHelper.importOMAttribute(oma, relatesToHeader);
+                            }
+                        }
                     }
                 }
             }

Modified: webservices/axis2/trunk/java/modules/addressing/test-resources/valid-messages/final/soapmessage.xml
URL: http://svn.apache.org/viewvc/webservices/axis2/trunk/java/modules/addressing/test-resources/valid-messages/final/soapmessage.xml?view=diff&rev=493016&r1=493015&r2=493016
==============================================================================
--- webservices/axis2/trunk/java/modules/addressing/test-resources/valid-messages/final/soapmessage.xml (original)
+++ webservices/axis2/trunk/java/modules/addressing/test-resources/valid-messages/final/soapmessage.xml Fri Jan  5 04:36:50 2007
@@ -42,7 +42,7 @@
             </wsa:Metadata>
             <axis2:EPRExt axis2:AttrExt="123456789">123456789</axis2:EPRExt>
         </wsa:FaultTo>
-        <wsa:RelatesTo>http://some.previous.message</wsa:RelatesTo>
+        <wsa:RelatesTo axis2:AttrExt="123456789">http://some.previous.message</wsa:RelatesTo>
         <wsa:RelatesTo RelationshipType="http://some.custom.relationship">http://identifier.of.other.message/</wsa:RelatesTo>
     </soapenv:Header>
     <soapenv:Body>

Modified: webservices/axis2/trunk/java/modules/addressing/test-resources/valid-messages/submission/soapmessage.xml
URL: http://svn.apache.org/viewvc/webservices/axis2/trunk/java/modules/addressing/test-resources/valid-messages/submission/soapmessage.xml?view=diff&rev=493016&r1=493015&r2=493016
==============================================================================
--- webservices/axis2/trunk/java/modules/addressing/test-resources/valid-messages/submission/soapmessage.xml (original)
+++ webservices/axis2/trunk/java/modules/addressing/test-resources/valid-messages/submission/soapmessage.xml Fri Jan  5 04:36:50 2007
@@ -40,7 +40,7 @@
             </wsa:ReferenceProperties>
             <axis2:EPRExt axis2:AttrExt="123456789">123456789</axis2:EPRExt>
         </wsa:FaultTo>
-        <wsa:RelatesTo>http://some.previous.message</wsa:RelatesTo>
+        <wsa:RelatesTo axis2:AttrExt="123456789">http://some.previous.message</wsa:RelatesTo>
         <wsa:RelatesTo RelationshipType="axis2:some.custom.relationship">http://identifier.of.other.message/</wsa:RelatesTo>
         
     </soapenv:Header>

Modified: webservices/axis2/trunk/java/modules/addressing/test/org/apache/axis2/handlers/addressing/AddressingInHandlerTestBase.java
URL: http://svn.apache.org/viewvc/webservices/axis2/trunk/java/modules/addressing/test/org/apache/axis2/handlers/addressing/AddressingInHandlerTestBase.java?view=diff&rev=493016&r1=493015&r2=493016
==============================================================================
--- webservices/axis2/trunk/java/modules/addressing/test/org/apache/axis2/handlers/addressing/AddressingInHandlerTestBase.java (original)
+++ webservices/axis2/trunk/java/modules/addressing/test/org/apache/axis2/handlers/addressing/AddressingInHandlerTestBase.java Fri Jan  5 04:36:50 2007
@@ -297,6 +297,22 @@
         assertTrue("Extensibility attribute not found on MessageID", attributeFound);
     }
     
+    private void assertRelatesToHasExtensibilityAttribute(RelatesTo rt){
+        boolean attributeFound=false;
+        ArrayList attributes = rt.getExtensibilityAttributes();
+        if(attributes!=null){
+            Iterator iter = attributes.iterator();
+            while(iter.hasNext()){
+                OMAttribute oa = (OMAttribute)iter.next();
+                if(oa.getLocalName().equals("AttrExt")){
+                    attributeFound = true;
+                    assertEquals("Attribute value incorrectly deserialised",oa.getAttributeValue(),"123456789");
+                }
+            }
+        }
+        assertTrue("Extensibility attribute not found on RelatesTo", attributeFound);
+    }
+    
     private void assertEPRAddressHasExtensibilityAttribute(EndpointReference epr){
         boolean attributeFound=false;
         ArrayList attributes = epr.getAddressAttributes();
@@ -342,7 +358,8 @@
     }
     
     private void assertRelationships(Options options) {
-    	assertNotNull(options.getRelatesTo());
+        assertNotNull(options.getRelatesTo());
+        assertRelatesToHasExtensibilityAttribute(options.getRelatesTo());
     	assertEquals(options.getRelatesTo().getValue(),"http://some.previous.message");
     	assertEquals(options.getRelatesTo(secondRelationshipType).getValue(),"http://identifier.of.other.message/");
 	}

Modified: webservices/axis2/trunk/java/modules/kernel/src/org/apache/axis2/addressing/RelatesTo.java
URL: http://svn.apache.org/viewvc/webservices/axis2/trunk/java/modules/kernel/src/org/apache/axis2/addressing/RelatesTo.java?view=diff&rev=493016&r1=493015&r2=493016
==============================================================================
--- webservices/axis2/trunk/java/modules/kernel/src/org/apache/axis2/addressing/RelatesTo.java (original)
+++ webservices/axis2/trunk/java/modules/kernel/src/org/apache/axis2/addressing/RelatesTo.java Fri Jan  5 04:36:50 2007
@@ -18,6 +18,7 @@
 package org.apache.axis2.addressing;
 
 import java.io.Serializable;
+import java.util.ArrayList;
 
 /**
  * Class RelatesTo
@@ -36,6 +37,8 @@
      */
     private String value;
 
+    private ArrayList extensibilityAttributes = null;
+    
     /**
      * Constructor RelatesTo
      *
@@ -89,6 +92,14 @@
      */
     public void setValue(String value) {
         this.value = value;
+    }
+    
+    public ArrayList getExtensibilityAttributes() {
+        return extensibilityAttributes;
+    }
+
+    public void setExtensibilityAttributes(ArrayList extensibilityAttributes) {
+        this.extensibilityAttributes = extensibilityAttributes;
     }
     
     /*



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