axis-java-dev mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From ruchi...@apache.org
Subject svn commit: r525184 - in /webservices/axis2/branches/java/1_1/modules/security/src/org/apache/rampart: RampartEngine.java handler/WSDoAllReceiver.java handler/WSDoAllSender.java util/Axis2Util.java
Date Tue, 03 Apr 2007 15:49:44 GMT
Author: ruchithf
Date: Tue Apr  3 08:49:43 2007
New Revision: 525184

URL: http://svn.apache.org/viewvc?view=rev&rev=525184
Log:
Making rampart-1.1 branch code depend on VM's DOM impl rather than DOOM

Modified:
    webservices/axis2/branches/java/1_1/modules/security/src/org/apache/rampart/RampartEngine.java
    webservices/axis2/branches/java/1_1/modules/security/src/org/apache/rampart/handler/WSDoAllReceiver.java
    webservices/axis2/branches/java/1_1/modules/security/src/org/apache/rampart/handler/WSDoAllSender.java
    webservices/axis2/branches/java/1_1/modules/security/src/org/apache/rampart/util/Axis2Util.java

Modified: webservices/axis2/branches/java/1_1/modules/security/src/org/apache/rampart/RampartEngine.java
URL: http://svn.apache.org/viewvc/webservices/axis2/branches/java/1_1/modules/security/src/org/apache/rampart/RampartEngine.java?view=diff&rev=525184&r1=525183&r2=525184
==============================================================================
--- webservices/axis2/branches/java/1_1/modules/security/src/org/apache/rampart/RampartEngine.java
(original)
+++ webservices/axis2/branches/java/1_1/modules/security/src/org/apache/rampart/RampartEngine.java
Tue Apr  3 08:49:43 2007
@@ -44,7 +44,7 @@
                 WSSecurityUtil.findElement(rmd.getDocument().getDocumentElement(), 
                         "Fault", 
                         rmd.getSoapConstants().getEnvelopeURI()) != null) {
-            SOAPEnvelope env = Axis2Util.getSOAPEnvelopeFromDOOMDocument(rmd.getDocument());
+            SOAPEnvelope env = Axis2Util.getSOAPEnvelopeFromDOOMDocument(rmd.getDocument(),
false);
 
             //Convert back to llom since the inflow cannot use llom
             msgCtx.setEnvelope(env);
@@ -78,7 +78,7 @@
         }
         
 
-        SOAPEnvelope env = Axis2Util.getSOAPEnvelopeFromDOOMDocument(rmd.getDocument());
+        SOAPEnvelope env = Axis2Util.getSOAPEnvelopeFromDOOMDocument(rmd.getDocument(), false);
 
         //Convert back to llom since the inflow cannot use DOOM
         msgCtx.setEnvelope(env);

Modified: webservices/axis2/branches/java/1_1/modules/security/src/org/apache/rampart/handler/WSDoAllReceiver.java
URL: http://svn.apache.org/viewvc/webservices/axis2/branches/java/1_1/modules/security/src/org/apache/rampart/handler/WSDoAllReceiver.java?view=diff&rev=525184&r1=525183&r2=525184
==============================================================================
--- webservices/axis2/branches/java/1_1/modules/security/src/org/apache/rampart/handler/WSDoAllReceiver.java
(original)
+++ webservices/axis2/branches/java/1_1/modules/security/src/org/apache/rampart/handler/WSDoAllReceiver.java
Tue Apr  3 08:49:43 2007
@@ -76,6 +76,7 @@
                 .getProperty(WSSHandlerConstants.DISABLE_DOOM);
         boolean disableDoom = disableDoomValue != null
                 && Constants.VALUE_TRUE.equalsIgnoreCase(disableDoomValue);
+        disableDoom = true;
 
         RequestData reqData = new RequestData();
         try {
@@ -144,7 +145,7 @@
 
         // Convert back to llom since the inflow cannot use llom
         msgContext.setEnvelope(Axis2Util
-                .getSOAPEnvelopeFromDOOMDocument(config.getDocument()));
+                .getSOAPEnvelopeFromDOOMDocument(config.getDocument(), false));
     }
 
     private void processBasic(MessageContext msgContext, boolean disableDoom, RequestData
reqData)
@@ -277,7 +278,7 @@
          * Set the new SOAPEnvelope
          */
 
-        msgContext.setEnvelope(Axis2Util.getSOAPEnvelopeFromDOOMDocument(doc));
+        msgContext.setEnvelope(Axis2Util.getSOAPEnvelopeFromDOOMDocument(doc, disableDoom));
 
         /*
          * After setting the new current message, probably modified because of

Modified: webservices/axis2/branches/java/1_1/modules/security/src/org/apache/rampart/handler/WSDoAllSender.java
URL: http://svn.apache.org/viewvc/webservices/axis2/branches/java/1_1/modules/security/src/org/apache/rampart/handler/WSDoAllSender.java?view=diff&rev=525184&r1=525183&r2=525184
==============================================================================
--- webservices/axis2/branches/java/1_1/modules/security/src/org/apache/rampart/handler/WSDoAllSender.java
(original)
+++ webservices/axis2/branches/java/1_1/modules/security/src/org/apache/rampart/handler/WSDoAllSender.java
Tue Apr  3 08:49:43 2007
@@ -314,6 +314,7 @@
         if (doDebug) {
             log.debug("WSDoAllSender: exit invoke()");
         }
+        log.debug(msgContext.getEnvelope());
     }
     
 

Modified: webservices/axis2/branches/java/1_1/modules/security/src/org/apache/rampart/util/Axis2Util.java
URL: http://svn.apache.org/viewvc/webservices/axis2/branches/java/1_1/modules/security/src/org/apache/rampart/util/Axis2Util.java?view=diff&rev=525184&r1=525183&r2=525184
==============================================================================
--- webservices/axis2/branches/java/1_1/modules/security/src/org/apache/rampart/util/Axis2Util.java
(original)
+++ webservices/axis2/branches/java/1_1/modules/security/src/org/apache/rampart/util/Axis2Util.java
Tue Apr  3 08:49:43 2007
@@ -28,11 +28,13 @@
 import org.apache.axiom.soap.impl.builder.StAXSOAPModelBuilder;
 import org.apache.rampart.handler.WSSHandlerConstants;
 import org.apache.ws.security.WSSecurityException;
+import org.apache.xml.security.utils.XMLUtils;
 import org.w3c.dom.Document;
 import org.w3c.dom.Element;
 
 import javax.xml.parsers.DocumentBuilderFactory;
 import javax.xml.stream.FactoryConfigurationError;
+import javax.xml.stream.XMLInputFactory;
 import javax.xml.stream.XMLStreamReader;
 
 import java.io.ByteArrayInputStream;
@@ -123,20 +125,33 @@
 		}
 	}
 
-	public static SOAPEnvelope getSOAPEnvelopeFromDOOMDocument(Document doc)
+	public static SOAPEnvelope getSOAPEnvelopeFromDOOMDocument(Document doc, boolean dd)
             throws WSSecurityException {
 
-        try {
-            XMLStreamReader reader = ((OMElement) doc.getDocumentElement())
-                    .getXMLStreamReader();
-            StAXSOAPModelBuilder stAXSOAPModelBuilder = new StAXSOAPModelBuilder(
-                    reader, null);
-            SOAPEnvelope envelope = stAXSOAPModelBuilder.getSOAPEnvelope();
-            envelope.build();
-            return envelope;
-            
-        } catch (FactoryConfigurationError e) {
-            throw new WSSecurityException(e.getMessage());
+        if(!dd) {
+            try {
+                XMLStreamReader reader = ((OMElement) doc.getDocumentElement())
+                        .getXMLStreamReader();
+                StAXSOAPModelBuilder stAXSOAPModelBuilder = new StAXSOAPModelBuilder(
+                        reader, null);
+                SOAPEnvelope envelope = stAXSOAPModelBuilder.getSOAPEnvelope();
+                envelope.build();
+                return envelope;
+                
+            } catch (FactoryConfigurationError e) {
+                throw new WSSecurityException(e.getMessage());
+            }
+        } else {
+            try {
+                ByteArrayOutputStream os = new ByteArrayOutputStream();
+                XMLUtils.outputDOM(doc.getDocumentElement(), os, true);
+                ByteArrayInputStream bais =  new ByteArrayInputStream(os.toByteArray());
+                
+                StAXSOAPModelBuilder stAXSOAPModelBuilder = new StAXSOAPModelBuilder(XMLInputFactory.newInstance().createXMLStreamReader(bais),
null);
+                return stAXSOAPModelBuilder.getSOAPEnvelope();
+            } catch (Exception e) {
+                throw new WSSecurityException(e.getMessage());
+            }
         }
 
     }



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


Mime
View raw message