You are viewing a plain text version of this content. The canonical link for it is here.
Posted to java-dev@axis.apache.org by ru...@apache.org on 2006/09/30 15:59:00 UTC

svn commit: r451602 - in /webservices/axis2/trunk/java/modules: addressing/src/org/apache/axis2/addressing/ addressing/src/org/apache/axis2/handlers/addressing/ integration/test/org/apache/rampart/

Author: ruchithf
Date: Sat Sep 30 06:59:00 2006
New Revision: 451602

URL: http://svn.apache.org/viewvc?view=rev&rev=451602
Log:
Checking in the fix the build break caused by : 
http://svn.apache.org/viewvc?view=rev&rev=451179

This was due to EndpointRefernceHelper using a method in SOAPFactory which is not implemented properly in DOOM. (https://issues.apache.org/jira/browse/WSCOMMONS-103). This is fixed in the latest AXIOM snapshot. 

But to get the earlier commented out integration test scenario to work with we cannot use createSOAPHeaderBlock(String localName, OMNamespace ns) method. Once we switch from Axiom 1.1.1 to the latest Axiom code we can get rid of this workaround.

Uncommented the commented out test scenario back


Modified:
    webservices/axis2/trunk/java/modules/addressing/src/org/apache/axis2/addressing/EndpointReferenceHelper.java
    webservices/axis2/trunk/java/modules/addressing/src/org/apache/axis2/handlers/addressing/AddressingOutHandler.java
    webservices/axis2/trunk/java/modules/integration/test/org/apache/rampart/RampartTest.java

Modified: webservices/axis2/trunk/java/modules/addressing/src/org/apache/axis2/addressing/EndpointReferenceHelper.java
URL: http://svn.apache.org/viewvc/webservices/axis2/trunk/java/modules/addressing/src/org/apache/axis2/addressing/EndpointReferenceHelper.java?view=diff&rev=451602&r1=451601&r2=451602
==============================================================================
--- webservices/axis2/trunk/java/modules/addressing/src/org/apache/axis2/addressing/EndpointReferenceHelper.java (original)
+++ webservices/axis2/trunk/java/modules/addressing/src/org/apache/axis2/addressing/EndpointReferenceHelper.java Sat Sep 30 06:59:00 2006
@@ -170,9 +170,12 @@
         
         if (qname.getPrefix() != null) {
             OMNamespace wrapNs = factory.createOMNamespace(qname.getNamespaceURI(), qname.getPrefix());
-            if (factory instanceof SOAPFactory)
-                eprElement = ((SOAPFactory) factory).createSOAPHeaderBlock(qname.getLocalPart(), wrapNs);
-            else
+//Temp workaround to aviod hitting -  https://issues.apache.org/jira/browse/WSCOMMONS-103 
+//since Axis2 next release (1.1) will be based on Axiom 1.1 
+//We can get rid of this fix with the Axiom SNAPSHOT
+//            if (factory instanceof SOAPFactory)
+//                eprElement = ((SOAPFactory) factory).createSOAPHeaderBlock(qname.getLocalPart(), wrapNs);
+//            else
                 eprElement = factory.createOMElement(qname.getLocalPart(), wrapNs);
             
             OMNamespace wsaNS = factory.createOMNamespace(addressingNamespace, AddressingConstants.WSA_DEFAULT_PREFIX);

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=451602&r1=451601&r2=451602
==============================================================================
--- 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 Sat Sep 30 06:59:00 2006
@@ -19,13 +19,13 @@
 import org.apache.axiom.om.OMElement;
 import org.apache.axiom.om.OMNamespace;
 import org.apache.axiom.om.util.ElementHelper;
+import org.apache.axiom.soap.SOAPConstants;
 import org.apache.axiom.soap.SOAPEnvelope;
 import org.apache.axiom.soap.SOAPFactory;
 import org.apache.axiom.soap.SOAPFault;
 import org.apache.axiom.soap.SOAPHeader;
 import org.apache.axiom.soap.SOAPHeaderBlock;
 import org.apache.axis2.AxisFault;
-import org.apache.axis2.util.JavaUtils;
 import org.apache.axis2.addressing.AddressingConstants;
 import org.apache.axis2.addressing.AddressingFaultsHelper;
 import org.apache.axis2.addressing.EndpointReference;
@@ -33,8 +33,10 @@
 import org.apache.axis2.addressing.RelatesTo;
 import org.apache.axis2.client.Options;
 import org.apache.axis2.context.MessageContext;
+import org.apache.axis2.util.JavaUtils;
 
 import javax.xml.namespace.QName;
+
 import java.util.Iterator;
 import java.util.List;
 import java.util.Map;
@@ -331,9 +333,21 @@
         if (JavaUtils.isTrueExplicitly(flag)) {
             List headers = envelope.getHeader().getHeaderBlocksWithNSURI(addressingNamespaceObject.getNamespaceURI());
             Iterator iterator = headers.iterator();
+
             while (iterator.hasNext()) {
-                SOAPHeaderBlock soapHeaderBlock = (SOAPHeaderBlock) iterator.next();
-                soapHeaderBlock.setMustUnderstand(true);
+                OMElement elem = (OMElement)iterator.next();
+                if(elem instanceof SOAPHeaderBlock) {
+                    SOAPHeaderBlock soapHeaderBlock = (SOAPHeaderBlock) elem;
+                    soapHeaderBlock.setMustUnderstand(true);  
+                } else {
+//                  Temp workaround to aviod hitting -  https://issues.apache.org/jira/browse/WSCOMMONS-103 
+//                  since Axis2 next release (1.1) will be based on Axiom 1.1 
+//                  We can get rid of this fix with the Axiom SNAPSHOT
+                    elem.addAttribute(SOAPConstants.ATTR_MUSTUNDERSTAND,
+                             "1",
+                            envelope.getNamespace());
+                }
+                
             }
         }
     }

Modified: webservices/axis2/trunk/java/modules/integration/test/org/apache/rampart/RampartTest.java
URL: http://svn.apache.org/viewvc/webservices/axis2/trunk/java/modules/integration/test/org/apache/rampart/RampartTest.java?view=diff&rev=451602&r1=451601&r2=451602
==============================================================================
--- webservices/axis2/trunk/java/modules/integration/test/org/apache/rampart/RampartTest.java (original)
+++ webservices/axis2/trunk/java/modules/integration/test/org/apache/rampart/RampartTest.java Sat Sep 30 06:59:00 2006
@@ -84,27 +84,27 @@
                 serviceClient.sendReceive(getEchoElement());
             }
 
-//            
-//            for (int i = 1; i <= 1; i++) { //<-The number of tests we have
-//                if(!basic256Supported && (i == 3 || i == 4 || i ==5)) {
-//                    //Skip the Basic256 tests
-//                    continue;
-//                }
-//                System.out.println("Testing WS-SecConv: custom scenario " + i);
-//                options.setAction("urn:echo");
-//                options.setTo(new EndpointReference("http://127.0.0.1:" + PORT + "/axis2/services/SecureServiceSC" + i));
-//                options.setProperty(RampartMessageData.KEY_RAMPART_POLICY, loadPolicy("test-resources/rampart/policy/sc-" + i + ".xml"));
-//                serviceClient.setOptions(options);
-//
-//                //Blocking invocation
-//                serviceClient.sendReceive(getEchoElement());
-//                serviceClient.sendReceive(getEchoElement());
-//                
-//                //Cancel the token
-//                options.setAction(RahasConstants.WST_NS_05_02 + RahasConstants.RST_ACTION_CANCEL_SCT);
-//                serviceClient.sendReceive(getEchoElement());
-//                
-//            }
+            
+            for (int i = 1; i <= 1; i++) { //<-The number of tests we have
+                if(!basic256Supported && (i == 3 || i == 4 || i ==5)) {
+                    //Skip the Basic256 tests
+                    continue;
+                }
+                System.out.println("Testing WS-SecConv: custom scenario " + i);
+                options.setAction("urn:echo");
+                options.setTo(new EndpointReference("http://127.0.0.1:" + PORT + "/axis2/services/SecureServiceSC" + i));
+                options.setProperty(RampartMessageData.KEY_RAMPART_POLICY, loadPolicy("test-resources/rampart/policy/sc-" + i + ".xml"));
+                serviceClient.setOptions(options);
+
+                //Blocking invocation
+                serviceClient.sendReceive(getEchoElement());
+                serviceClient.sendReceive(getEchoElement());
+                
+                //Cancel the token
+                options.setAction(RahasConstants.WST_NS_05_02 + RahasConstants.RST_ACTION_CANCEL_SCT);
+                serviceClient.sendReceive(getEchoElement());
+                
+            }
 
         } catch (Exception e) {
             e.printStackTrace();



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