axis-java-dev mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From ruchi...@apache.org
Subject svn commit: r383807 [3/3] - in /webservices/axis2/trunk/java/modules: core/src/org/apache/axis2/transport/http/ doom/src/org/apache/axis2/om/impl/dom/ doom/src/org/apache/axis2/om/impl/dom/factory/ doom/src/org/apache/axis2/om/impl/dom/jaxp/ doom/src/o...
Date Tue, 07 Mar 2006 07:05:40 GMT
Modified: webservices/axis2/trunk/java/modules/doom/src/org/apache/axis2/soap/impl/dom/soap12/SOAP12FaultSubCodeImpl.java
URL: http://svn.apache.org/viewcvs/webservices/axis2/trunk/java/modules/doom/src/org/apache/axis2/soap/impl/dom/soap12/SOAP12FaultSubCodeImpl.java?rev=383807&r1=383806&r2=383807&view=diff
==============================================================================
--- webservices/axis2/trunk/java/modules/doom/src/org/apache/axis2/soap/impl/dom/soap12/SOAP12FaultSubCodeImpl.java (original)
+++ webservices/axis2/trunk/java/modules/doom/src/org/apache/axis2/soap/impl/dom/soap12/SOAP12FaultSubCodeImpl.java Mon Mar  6 23:05:35 2006
@@ -20,6 +20,7 @@
 import org.apache.ws.commons.om.OMElement;
 import org.apache.ws.commons.om.OMXMLParserWrapper;
 import org.apache.ws.commons.soap.SOAP12Constants;
+import org.apache.ws.commons.soap.SOAPFactory;
 import org.apache.ws.commons.soap.SOAPFaultCode;
 import org.apache.ws.commons.soap.SOAPFaultSubCode;
 import org.apache.ws.commons.soap.SOAPFaultValue;
@@ -27,45 +28,56 @@
 
 public class SOAP12FaultSubCodeImpl extends SOAPFaultSubCodeImpl {
     //changed
-    public SOAP12FaultSubCodeImpl(SOAPFaultCode parent) throws SOAPProcessingException {
-        super(parent, SOAP12Constants.SOAP_FAULT_SUB_CODE_LOCAL_NAME);
+    public SOAP12FaultSubCodeImpl(SOAPFaultCode parent, SOAPFactory factory)
+            throws SOAPProcessingException {
+        super(parent, SOAP12Constants.SOAP_FAULT_SUB_CODE_LOCAL_NAME, factory);
     }
 
     //changed
     public SOAP12FaultSubCodeImpl(SOAPFaultCode parent,
-                                  OMXMLParserWrapper builder) {
-        super(parent, SOAP12Constants.SOAP_FAULT_SUB_CODE_LOCAL_NAME, builder);
+                                  OMXMLParserWrapper builder,
+                                  SOAPFactory factory) {
+        super(parent, SOAP12Constants.SOAP_FAULT_SUB_CODE_LOCAL_NAME, builder,
+                factory);
     }
 
-    public SOAP12FaultSubCodeImpl(SOAPFaultSubCode parent) throws SOAPProcessingException {
-        super(parent, SOAP12Constants.SOAP_FAULT_SUB_CODE_LOCAL_NAME);
+    public SOAP12FaultSubCodeImpl(SOAPFaultSubCode parent, SOAPFactory factory)
+            throws SOAPProcessingException {
+        super(parent, SOAP12Constants.SOAP_FAULT_SUB_CODE_LOCAL_NAME, factory);
     }
 
     public SOAP12FaultSubCodeImpl(SOAPFaultSubCode parent,
-                                  OMXMLParserWrapper builder) {
-        super(parent, SOAP12Constants.SOAP_FAULT_SUB_CODE_LOCAL_NAME, builder);
+                                  OMXMLParserWrapper builder,
+                                  SOAPFactory factory) {
+        super(parent, SOAP12Constants.SOAP_FAULT_SUB_CODE_LOCAL_NAME, builder,
+                factory);
     }
 
     protected void checkParent(OMElement parent) throws SOAPProcessingException {
         if (!((parent instanceof SOAP12FaultSubCodeImpl) ||
                 (parent instanceof SOAP12FaultCodeImpl))) {
             throw new SOAPProcessingException(
-                    "Expecting SOAP 1.2 implementation of SOAP FaultSubCode or SOAP FaultCodeValue as the parent. But received some other implementation");
+                    "Expecting SOAP 1.2 implementation of SOAP FaultSubCode " +
+                    "or SOAP FaultCodeValue as the parent. But received some " +
+                    "other implementation");
         }
     }
 
     public void setSubCode(SOAPFaultSubCode subCode) throws SOAPProcessingException {
         if (!(subCode instanceof SOAP12FaultSubCodeImpl)) {
             throw new SOAPProcessingException(
-                    "Expecting SOAP 1.2 implementation of SOAP Fault Sub Code. But received some other implementation");
+                    "Expecting SOAP 1.2 implementation of SOAP Fault " +
+                    "Sub Code. But received some other implementation");
         }
         super.setSubCode(subCode);
     }
 
-    public void setValue(SOAPFaultValue soapFaultSubCodeValue) throws SOAPProcessingException {
+    public void setValue(SOAPFaultValue soapFaultSubCodeValue)
+            throws SOAPProcessingException {
         if (!(soapFaultSubCodeValue instanceof SOAP12FaultValueImpl)) {
             throw new SOAPProcessingException(
-                    "Expecting SOAP 1.2 implementation of SOAP Fault Value. But received some other implementation");
+                    "Expecting SOAP 1.2 implementation of SOAP Fault Value. " +
+                    "But received some other implementation");
         }
         super.setValue(soapFaultSubCodeValue);
     }

Modified: webservices/axis2/trunk/java/modules/doom/src/org/apache/axis2/soap/impl/dom/soap12/SOAP12FaultTextImpl.java
URL: http://svn.apache.org/viewcvs/webservices/axis2/trunk/java/modules/doom/src/org/apache/axis2/soap/impl/dom/soap12/SOAP12FaultTextImpl.java?rev=383807&r1=383806&r2=383807&view=diff
==============================================================================
--- webservices/axis2/trunk/java/modules/doom/src/org/apache/axis2/soap/impl/dom/soap12/SOAP12FaultTextImpl.java (original)
+++ webservices/axis2/trunk/java/modules/doom/src/org/apache/axis2/soap/impl/dom/soap12/SOAP12FaultTextImpl.java Mon Mar  6 23:05:35 2006
@@ -19,23 +19,27 @@
 import org.apache.axis2.soap.impl.dom.SOAPFaultTextImpl;
 import org.apache.ws.commons.om.OMElement;
 import org.apache.ws.commons.om.OMXMLParserWrapper;
+import org.apache.ws.commons.soap.SOAPFactory;
 import org.apache.ws.commons.soap.SOAPFaultReason;
 import org.apache.ws.commons.soap.SOAPProcessingException;
 
 public class SOAP12FaultTextImpl extends SOAPFaultTextImpl {
-    public SOAP12FaultTextImpl(SOAPFaultReason parent) throws SOAPProcessingException {
-        super(parent);
+    
+    public SOAP12FaultTextImpl(SOAPFaultReason parent, SOAPFactory factory) throws SOAPProcessingException {
+        super(parent, factory);
     }
 
     public SOAP12FaultTextImpl(SOAPFaultReason parent,
-                               OMXMLParserWrapper builder) {
-        super(parent, builder);
+                               OMXMLParserWrapper builder,
+                               SOAPFactory factory) {
+        super(parent, builder, factory);
     }
 
     protected void checkParent(OMElement parent) throws SOAPProcessingException {
         if (!(parent instanceof SOAP12FaultReasonImpl)) {
             throw new SOAPProcessingException(
-                    "Expecting SOAP 1.2 implementation of SOAP FaultReason as the parent. But received some other implementation");
+                    "Expecting SOAP 1.2 implementation of SOAP FaultReason " +
+                    "as the parent. But received some other implementation");
         }
     }
 }

Modified: webservices/axis2/trunk/java/modules/doom/src/org/apache/axis2/soap/impl/dom/soap12/SOAP12FaultValueImpl.java
URL: http://svn.apache.org/viewcvs/webservices/axis2/trunk/java/modules/doom/src/org/apache/axis2/soap/impl/dom/soap12/SOAP12FaultValueImpl.java?rev=383807&r1=383806&r2=383807&view=diff
==============================================================================
--- webservices/axis2/trunk/java/modules/doom/src/org/apache/axis2/soap/impl/dom/soap12/SOAP12FaultValueImpl.java (original)
+++ webservices/axis2/trunk/java/modules/doom/src/org/apache/axis2/soap/impl/dom/soap12/SOAP12FaultValueImpl.java Mon Mar  6 23:05:35 2006
@@ -19,15 +19,17 @@
 import org.apache.axis2.soap.impl.dom.SOAPFaultValueImpl;
 import org.apache.ws.commons.om.OMElement;
 import org.apache.ws.commons.om.OMXMLParserWrapper;
+import org.apache.ws.commons.soap.SOAPFactory;
 import org.apache.ws.commons.soap.SOAPProcessingException;
 
 public class SOAP12FaultValueImpl extends SOAPFaultValueImpl {
-    public SOAP12FaultValueImpl(OMElement parent) throws SOAPProcessingException {
-        super(parent);
+    
+    public SOAP12FaultValueImpl(OMElement parent, SOAPFactory factory) throws SOAPProcessingException {
+        super(parent, factory);
     }
 
-    public SOAP12FaultValueImpl(OMElement parent, OMXMLParserWrapper builder) {
-        super(parent, builder);
+    public SOAP12FaultValueImpl(OMElement parent, OMXMLParserWrapper builder, SOAPFactory factory) {
+        super(parent, builder, factory);
     }
 
     protected void checkParent(OMElement parent) throws SOAPProcessingException {

Modified: webservices/axis2/trunk/java/modules/doom/src/org/apache/axis2/soap/impl/dom/soap12/SOAP12HeaderBlockImpl.java
URL: http://svn.apache.org/viewcvs/webservices/axis2/trunk/java/modules/doom/src/org/apache/axis2/soap/impl/dom/soap12/SOAP12HeaderBlockImpl.java?rev=383807&r1=383806&r2=383807&view=diff
==============================================================================
--- webservices/axis2/trunk/java/modules/doom/src/org/apache/axis2/soap/impl/dom/soap12/SOAP12HeaderBlockImpl.java (original)
+++ webservices/axis2/trunk/java/modules/doom/src/org/apache/axis2/soap/impl/dom/soap12/SOAP12HeaderBlockImpl.java Mon Mar  6 23:05:35 2006
@@ -22,6 +22,7 @@
 import org.apache.ws.commons.om.OMXMLParserWrapper;
 import org.apache.ws.commons.soap.SOAP12Constants;
 import org.apache.ws.commons.soap.SOAPConstants;
+import org.apache.ws.commons.soap.SOAPFactory;
 import org.apache.ws.commons.soap.SOAPHeader;
 import org.apache.ws.commons.soap.SOAPProcessingException;
 
@@ -32,8 +33,9 @@
      */
     public SOAP12HeaderBlockImpl(String localName,
                                  OMNamespace ns,
-                                 SOAPHeader parent) throws SOAPProcessingException {
-        super(localName, ns, parent);
+                                 SOAPHeader parent,
+                                 SOAPFactory factory) throws SOAPProcessingException {
+        super(localName, ns, parent, factory);
         checkParent(parent);
     }
 
@@ -48,8 +50,9 @@
     public SOAP12HeaderBlockImpl(String localName,
                                  OMNamespace ns,
                                  SOAPHeader parent,
-                                 OMXMLParserWrapper builder) {
-        super(localName, ns, parent, builder);
+                                 OMXMLParserWrapper builder,
+                                 SOAPFactory factory) {
+        super(localName, ns, parent, builder, factory);
 
     }
 

Modified: webservices/axis2/trunk/java/modules/doom/src/org/apache/axis2/soap/impl/dom/soap12/SOAP12HeaderImpl.java
URL: http://svn.apache.org/viewcvs/webservices/axis2/trunk/java/modules/doom/src/org/apache/axis2/soap/impl/dom/soap12/SOAP12HeaderImpl.java?rev=383807&r1=383806&r2=383807&view=diff
==============================================================================
--- webservices/axis2/trunk/java/modules/doom/src/org/apache/axis2/soap/impl/dom/soap12/SOAP12HeaderImpl.java (original)
+++ webservices/axis2/trunk/java/modules/doom/src/org/apache/axis2/soap/impl/dom/soap12/SOAP12HeaderImpl.java Mon Mar  6 23:05:35 2006
@@ -24,6 +24,7 @@
 import org.apache.ws.commons.om.impl.llom.traverse.OMChildrenWithSpecificAttributeIterator;
 import org.apache.ws.commons.soap.SOAP12Constants;
 import org.apache.ws.commons.soap.SOAPEnvelope;
+import org.apache.ws.commons.soap.SOAPFactory;
 import org.apache.ws.commons.soap.SOAPHeaderBlock;
 import org.apache.ws.commons.soap.SOAPProcessingException;
 
@@ -34,8 +35,9 @@
     /**
      * @param envelope
      */
-    public SOAP12HeaderImpl(SOAPEnvelope envelope) throws SOAPProcessingException {
-        super(envelope);
+    public SOAP12HeaderImpl(SOAPEnvelope envelope, SOAPFactory factory)
+            throws SOAPProcessingException {
+        super(envelope, factory);
     }
 
     /**
@@ -44,8 +46,9 @@
      * @param envelope
      * @param builder
      */
-    public SOAP12HeaderImpl(SOAPEnvelope envelope, OMXMLParserWrapper builder) {
-        super(envelope, builder);
+    public SOAP12HeaderImpl(SOAPEnvelope envelope, OMXMLParserWrapper builder,
+            SOAPFactory factory) {
+        super(envelope, builder, factory);
     }
 
     public SOAPHeaderBlock addHeaderBlock(String localName, OMNamespace ns) throws OMException {
@@ -61,7 +64,8 @@
 
         SOAPHeaderBlock soapHeaderBlock = null;
         try {
-            soapHeaderBlock = new SOAP12HeaderBlockImpl(localName, ns, this);
+            soapHeaderBlock = new SOAP12HeaderBlockImpl(localName, ns, this,
+                    (SOAPFactory)this.factory);
         } catch (SOAPProcessingException e) {
             throw new OMException(e);
         }

Modified: webservices/axis2/trunk/java/modules/doom/test/org/apache/axis2/om/impl/dom/DocumentImplTest.java
URL: http://svn.apache.org/viewcvs/webservices/axis2/trunk/java/modules/doom/test/org/apache/axis2/om/impl/dom/DocumentImplTest.java?rev=383807&r1=383806&r2=383807&view=diff
==============================================================================
--- webservices/axis2/trunk/java/modules/doom/test/org/apache/axis2/om/impl/dom/DocumentImplTest.java (original)
+++ webservices/axis2/trunk/java/modules/doom/test/org/apache/axis2/om/impl/dom/DocumentImplTest.java Mon Mar  6 23:05:35 2006
@@ -16,6 +16,8 @@
 package org.apache.axis2.om.impl.dom;
 
 import junit.framework.TestCase;
+
+import org.apache.axis2.om.impl.dom.factory.OMDOMFactory;
 import org.w3c.dom.Attr;
 import org.w3c.dom.Element;
 import org.w3c.dom.Text;
@@ -33,7 +35,8 @@
 	public void testCreateElement() {
 		String tagName = "LocalName";
 		String namespace = "http://ws.apache.org/axis2/ns";
-		DocumentImpl doc = new DocumentImpl();
+        OMDOMFactory fac = new OMDOMFactory();
+		DocumentImpl doc = new DocumentImpl(fac);
 		Element elem = doc.createElement(tagName);
 		
 		assertEquals("Local name misnatch",tagName, elem.getNodeName());
@@ -50,7 +53,8 @@
 		String attrNs = "http://ws.apache.org/axis2/ns";
 		String attrNsPrefix = "axis2";
 		
-		DocumentImpl doc = new DocumentImpl();
+        OMDOMFactory fac = new OMDOMFactory();
+        DocumentImpl doc = new DocumentImpl(fac);
 		Attr attr = doc.createAttribute(attrName);
 
 		assertEquals("Attr name mismatch",attrName,attr.getName());
@@ -70,7 +74,8 @@
 	public void testCreateText() {
 		String textValue = "temp text value";
 		
-		DocumentImpl doc = new DocumentImpl();
+        OMDOMFactory fac = new OMDOMFactory();
+        DocumentImpl doc = new DocumentImpl(fac);
 		Text txt = doc.createTextNode(textValue);
 		
 		assertEquals("Text value mismatch", textValue, txt.getData());

Modified: webservices/axis2/trunk/java/modules/doom/test/org/apache/axis2/om/impl/dom/TextImplTest.java
URL: http://svn.apache.org/viewcvs/webservices/axis2/trunk/java/modules/doom/test/org/apache/axis2/om/impl/dom/TextImplTest.java?rev=383807&r1=383806&r2=383807&view=diff
==============================================================================
--- webservices/axis2/trunk/java/modules/doom/test/org/apache/axis2/om/impl/dom/TextImplTest.java (original)
+++ webservices/axis2/trunk/java/modules/doom/test/org/apache/axis2/om/impl/dom/TextImplTest.java Mon Mar  6 23:05:35 2006
@@ -64,7 +64,8 @@
 	public void testSplitText() {
 		String textValue = "temp text value";
 
-		DocumentImpl doc = new DocumentImpl();
+        OMDOMFactory fac = new OMDOMFactory();
+        DocumentImpl doc = new DocumentImpl(fac);
 
 		Text txt = doc.createTextNode(textValue);
 		txt.splitText(3);

Modified: webservices/axis2/trunk/java/modules/integration/src/test/interop/util/BodyElements.java
URL: http://svn.apache.org/viewcvs/webservices/axis2/trunk/java/modules/integration/src/test/interop/util/BodyElements.java?rev=383807&r1=383806&r2=383807&view=diff
==============================================================================
--- webservices/axis2/trunk/java/modules/integration/src/test/interop/util/BodyElements.java (original)
+++ webservices/axis2/trunk/java/modules/integration/src/test/interop/util/BodyElements.java Mon Mar  6 23:05:35 2006
@@ -81,7 +81,7 @@
     public static OMText getOriginalText(boolean optimized) {
         File file = new File("modules/integration/itest-resources/mtom/mtom.bin");
         DataHandler handler = new DataHandler(new FileDataSource(file));//
-        return new OMTextImpl(handler, optimized);
+        return new OMTextImpl(handler, optimized, OMAbstractFactory.getOMFactory());
     }
 
 }

Modified: webservices/axis2/trunk/java/modules/integration/test/org/apache/axis2/mtom/EchoRawMTOMCommonsChunkingTest.java
URL: http://svn.apache.org/viewcvs/webservices/axis2/trunk/java/modules/integration/test/org/apache/axis2/mtom/EchoRawMTOMCommonsChunkingTest.java?rev=383807&r1=383806&r2=383807&view=diff
==============================================================================
--- webservices/axis2/trunk/java/modules/integration/test/org/apache/axis2/mtom/EchoRawMTOMCommonsChunkingTest.java (original)
+++ webservices/axis2/trunk/java/modules/integration/test/org/apache/axis2/mtom/EchoRawMTOMCommonsChunkingTest.java Mon Mar  6 23:05:35 2006
@@ -81,7 +81,7 @@
                 expectedImage);
         expectedDH = new DataHandler(dataSource);
         OMElement subData = fac.createOMElement("subData", omNs);
-        OMText textData = new OMTextImpl(expectedDH);
+        OMText textData = new OMTextImpl(expectedDH, fac);
         subData.addChild(textData);
         data.addChild(subData);
         rpcWrapEle.addChild(data);

Modified: webservices/axis2/trunk/java/modules/integration/test/org/apache/axis2/mtom/EchoRawMTOMLoadTest.java
URL: http://svn.apache.org/viewcvs/webservices/axis2/trunk/java/modules/integration/test/org/apache/axis2/mtom/EchoRawMTOMLoadTest.java?rev=383807&r1=383806&r2=383807&view=diff
==============================================================================
--- webservices/axis2/trunk/java/modules/integration/test/org/apache/axis2/mtom/EchoRawMTOMLoadTest.java (original)
+++ webservices/axis2/trunk/java/modules/integration/test/org/apache/axis2/mtom/EchoRawMTOMLoadTest.java Mon Mar  6 23:05:35 2006
@@ -87,7 +87,7 @@
             OMElement subData = fac.createOMElement("subData", omNs);
             DataHandler dataHandler = new DataHandler("Thilina", "text/plain");
             //new ByteArrayDataSource(expectedByteArray));
-            textData = new OMTextImpl(dataHandler, true);
+            textData = new OMTextImpl(dataHandler, true, fac);
             subData.addChild(textData);
             data.addChild(subData);
 

Modified: webservices/axis2/trunk/java/modules/integration/test/org/apache/axis2/mtom/EchoRawMTOMTest.java
URL: http://svn.apache.org/viewcvs/webservices/axis2/trunk/java/modules/integration/test/org/apache/axis2/mtom/EchoRawMTOMTest.java?rev=383807&r1=383806&r2=383807&view=diff
==============================================================================
--- webservices/axis2/trunk/java/modules/integration/test/org/apache/axis2/mtom/EchoRawMTOMTest.java (original)
+++ webservices/axis2/trunk/java/modules/integration/test/org/apache/axis2/mtom/EchoRawMTOMTest.java Mon Mar  6 23:05:35 2006
@@ -94,7 +94,7 @@
         ImageDataSource dataSource = new ImageDataSource("test.jpg",
                 expectedImage);
         expectedDH = new DataHandler(dataSource);
-        expectedTextData = new OMTextImpl(expectedDH, true);
+        expectedTextData = new OMTextImpl(expectedDH, true, fac);
         data.addChild(expectedTextData);
         rpcWrapEle.addChild(data);
         return rpcWrapEle;

Modified: webservices/axis2/trunk/java/modules/integration/test/org/apache/axis2/mtom/EchoRawMTOMToBase64Test.java
URL: http://svn.apache.org/viewcvs/webservices/axis2/trunk/java/modules/integration/test/org/apache/axis2/mtom/EchoRawMTOMToBase64Test.java?rev=383807&r1=383806&r2=383807&view=diff
==============================================================================
--- webservices/axis2/trunk/java/modules/integration/test/org/apache/axis2/mtom/EchoRawMTOMToBase64Test.java (original)
+++ webservices/axis2/trunk/java/modules/integration/test/org/apache/axis2/mtom/EchoRawMTOMToBase64Test.java Mon Mar  6 23:05:35 2006
@@ -92,7 +92,7 @@
         byte[] byteArray = new byte[]{13, 56, 65, 32, 12, 12, 7, -3, -2, -1,
                 98};
         DataHandler dataHandler = new DataHandler(new ByteArrayDataSource(byteArray));
-        expectedTextData = new OMTextImpl(dataHandler, true);
+        expectedTextData = new OMTextImpl(dataHandler, true, fac);
         data.addChild(expectedTextData);
         rpcWrapEle.addChild(data);
         return rpcWrapEle;

Modified: webservices/axis2/trunk/java/modules/integration/test/org/apache/axis2/swa/EchoSwA.java
URL: http://svn.apache.org/viewcvs/webservices/axis2/trunk/java/modules/integration/test/org/apache/axis2/swa/EchoSwA.java?rev=383807&r1=383806&r2=383807&view=diff
==============================================================================
--- webservices/axis2/trunk/java/modules/integration/test/org/apache/axis2/swa/EchoSwA.java (original)
+++ webservices/axis2/trunk/java/modules/integration/test/org/apache/axis2/swa/EchoSwA.java Mon Mar  6 23:05:35 2006
@@ -52,7 +52,7 @@
             contentID = contentID.substring(4);
         }
         DataHandler dataHandler = attachment.getDataHandler(contentID);
-        OMText textNode = new OMTextImpl(dataHandler);
+        OMText textNode = new OMTextImpl(dataHandler, omEle.getOMFactory());
         omEle.build();
         child.detach();
         omEle.addChild(textNode);

Modified: webservices/axis2/trunk/java/modules/saaj/src/org/apache/axis2/saaj/AttachmentPartImpl.java
URL: http://svn.apache.org/viewcvs/webservices/axis2/trunk/java/modules/saaj/src/org/apache/axis2/saaj/AttachmentPartImpl.java?rev=383807&r1=383806&r2=383807&view=diff
==============================================================================
--- webservices/axis2/trunk/java/modules/saaj/src/org/apache/axis2/saaj/AttachmentPartImpl.java (original)
+++ webservices/axis2/trunk/java/modules/saaj/src/org/apache/axis2/saaj/AttachmentPartImpl.java Mon Mar  6 23:05:35 2006
@@ -369,6 +369,6 @@
     }
 
     public TextImpl getText(DocumentImpl doc) {
-        return new TextImpl(doc, omText.getText());
+        return new TextImpl(doc, omText.getText(), doc.getOMFactory());
     }
 }

Modified: webservices/axis2/trunk/java/modules/saaj/src/org/apache/axis2/saaj/NodeImplEx.java
URL: http://svn.apache.org/viewcvs/webservices/axis2/trunk/java/modules/saaj/src/org/apache/axis2/saaj/NodeImplEx.java?rev=383807&r1=383806&r2=383807&view=diff
==============================================================================
--- webservices/axis2/trunk/java/modules/saaj/src/org/apache/axis2/saaj/NodeImplEx.java (original)
+++ webservices/axis2/trunk/java/modules/saaj/src/org/apache/axis2/saaj/NodeImplEx.java Mon Mar  6 23:05:35 2006
@@ -15,6 +15,7 @@
  */
 package org.apache.axis2.saaj;
 
+import org.apache.axis2.om.impl.dom.DocumentImpl;
 import org.apache.axis2.om.impl.dom.NodeImpl;
 import org.apache.axis2.om.impl.dom.ElementImpl;
 import org.apache.axis2.soap.impl.dom.SOAPBodyImpl;
@@ -22,6 +23,7 @@
 import org.apache.ws.commons.om.OMContainer;
 import org.apache.ws.commons.om.OMElement;
 import org.apache.ws.commons.om.OMException;
+import org.apache.ws.commons.om.OMFactory;
 import org.apache.ws.commons.om.OMNode;
 import org.w3c.dom.Attr;
 import org.w3c.dom.DOMException;
@@ -40,6 +42,14 @@
  * getting and setting the parent of a node, and for removing a node.
  */
 public abstract class NodeImplEx extends NodeImpl implements Node {
+
+    /**
+     * @param ownerDocument
+     * @param factory
+     */
+    protected NodeImplEx(OMFactory factory) {
+        super(factory);
+    }
 
     protected SOAPElement parentElement;
     static final String SAAJ_NODE = "saaj.node";

Modified: webservices/axis2/trunk/java/modules/saaj/src/org/apache/axis2/saaj/SOAPBodyImpl.java
URL: http://svn.apache.org/viewcvs/webservices/axis2/trunk/java/modules/saaj/src/org/apache/axis2/saaj/SOAPBodyImpl.java?rev=383807&r1=383806&r2=383807&view=diff
==============================================================================
--- webservices/axis2/trunk/java/modules/saaj/src/org/apache/axis2/saaj/SOAPBodyImpl.java (original)
+++ webservices/axis2/trunk/java/modules/saaj/src/org/apache/axis2/saaj/SOAPBodyImpl.java Mon Mar  6 23:05:35 2006
@@ -21,6 +21,7 @@
 import org.apache.axis2.om.impl.dom.NamespaceImpl;
 import org.apache.axis2.soap.impl.dom.soap11.SOAP11FaultImpl;
 import org.apache.ws.commons.om.OMNode;
+import org.apache.ws.commons.soap.SOAPFactory;
 import org.w3c.dom.Document;
 import org.w3c.dom.Element;
 import org.w3c.dom.NodeList;
@@ -147,7 +148,7 @@
         if (isBodyElementAdded) {
             throw new SOAPException("A SOAPBodyElement has been already added to this SOAPBody");
         }
-        SOAP11FaultImpl fault = new SOAP11FaultImpl(omSOAPBody);
+        SOAP11FaultImpl fault = new SOAP11FaultImpl(omSOAPBody, (SOAPFactory)this.element.getOMFactory());
         SOAPFaultImpl saajSOAPFault = new SOAPFaultImpl(fault);
         ((NodeImpl) omSOAPBody.getFault()).setUserData(SAAJ_NODE, saajSOAPFault, null);
         return saajSOAPFault;
@@ -210,7 +211,8 @@
      * @throws SOAPException if there is a SOAP error
      */
     public SOAPFault addFault(Name faultCode, String faultString, Locale locale) throws SOAPException {
-        SOAP11FaultImpl fault = new SOAP11FaultImpl(omSOAPBody, new Exception(faultString));
+        SOAP11FaultImpl fault = new SOAP11FaultImpl(omSOAPBody, new Exception(
+                faultString), (SOAPFactory) this.element.getOMFactory());
         SOAPFaultImpl faultImpl = new SOAPFaultImpl(fault);
         faultImpl.setFaultCode(faultCode);
         if (locale != null) {
@@ -287,13 +289,16 @@
             localname = domEle.getTagName().substring(indexOfColon + 1);
 
             ns = new NamespaceImpl(domEle.getNamespaceURI(),
-                                   domEle.getTagName().substring(0, indexOfColon));
+                                   domEle.getTagName().substring(0, indexOfColon),
+                                   this.element.getOMFactory());
         } else {
             localname = domEle.getLocalName();
-            ns = new NamespaceImpl(domEle.getNamespaceURI(), domEle.getPrefix());
+            ns = new NamespaceImpl(domEle.getNamespaceURI(), domEle.getPrefix(),
+                    this.element.getOMFactory());
         }
         ElementImpl eleImpl =
-                new ElementImpl((DocumentImpl) this.getOwnerDocument(), localname, ns);
+                new ElementImpl((DocumentImpl) this.getOwnerDocument(), 
+                        localname, ns, this.element.getOMFactory());
 
         SOAPElementImpl saajEle = new SOAPElementImpl(eleImpl);
 
@@ -352,7 +357,8 @@
                 // silently replace node, as per saaj 1.2 spec
                 if (domNode instanceof ElementImpl) {
                     if (omSOAPBody.hasFault()) {
-                        SOAP11FaultImpl fault = new SOAP11FaultImpl(omSOAPBody);
+                        SOAP11FaultImpl fault = new SOAP11FaultImpl(omSOAPBody,
+                                (SOAPFactory) this.element.getOMFactory());
                         SOAPFaultImpl saajSOAPFault = new SOAPFaultImpl(fault);
                         ((NodeImpl) omSOAPBody.getFault()).setUserData(SAAJ_NODE, saajSOAPFault, null);
                         childElements.add(saajSOAPFault);

Modified: webservices/axis2/trunk/java/modules/saaj/src/org/apache/axis2/saaj/SOAPConnectionImpl.java
URL: http://svn.apache.org/viewcvs/webservices/axis2/trunk/java/modules/saaj/src/org/apache/axis2/saaj/SOAPConnectionImpl.java?rev=383807&r1=383806&r2=383807&view=diff
==============================================================================
--- webservices/axis2/trunk/java/modules/saaj/src/org/apache/axis2/saaj/SOAPConnectionImpl.java (original)
+++ webservices/axis2/trunk/java/modules/saaj/src/org/apache/axis2/saaj/SOAPConnectionImpl.java Mon Mar  6 23:05:35 2006
@@ -325,7 +325,8 @@
             if (contentID != null) {//This is an omEnvelope referencing an attachment
                 child.build();
                 AttachmentPart ap = ((AttachmentPart) attachments.get(contentID.trim()));
-                OMText text = new OMTextImpl(ap.getDataHandler(), true);
+                OMText text = new OMTextImpl(ap.getDataHandler(), true,
+                        omEnvelope.getOMFactory());
                 child.removeAttribute(hrefAttr);
                 child.addChild(text);
             } else {

Modified: webservices/axis2/trunk/java/modules/saaj/src/org/apache/axis2/saaj/SOAPElementImpl.java
URL: http://svn.apache.org/viewcvs/webservices/axis2/trunk/java/modules/saaj/src/org/apache/axis2/saaj/SOAPElementImpl.java?rev=383807&r1=383806&r2=383807&view=diff
==============================================================================
--- webservices/axis2/trunk/java/modules/saaj/src/org/apache/axis2/saaj/SOAPElementImpl.java (original)
+++ webservices/axis2/trunk/java/modules/saaj/src/org/apache/axis2/saaj/SOAPElementImpl.java Mon Mar  6 23:05:35 2006
@@ -52,6 +52,7 @@
     protected ElementImpl element;
 
     public SOAPElementImpl(ElementImpl element) {
+        super(element.getOMFactory());
         this.element = element;
     }
 

Modified: webservices/axis2/trunk/java/modules/saaj/src/org/apache/axis2/saaj/SOAPEnvelopeImpl.java
URL: http://svn.apache.org/viewcvs/webservices/axis2/trunk/java/modules/saaj/src/org/apache/axis2/saaj/SOAPEnvelopeImpl.java?rev=383807&r1=383806&r2=383807&view=diff
==============================================================================
--- webservices/axis2/trunk/java/modules/saaj/src/org/apache/axis2/saaj/SOAPEnvelopeImpl.java (original)
+++ webservices/axis2/trunk/java/modules/saaj/src/org/apache/axis2/saaj/SOAPEnvelopeImpl.java Mon Mar  6 23:05:35 2006
@@ -21,6 +21,7 @@
 import org.apache.axis2.om.impl.dom.TextImpl;
 import org.apache.axis2.soap.impl.dom.soap11.SOAP11BodyImpl;
 import org.apache.axis2.soap.impl.dom.soap11.SOAP11HeaderImpl;
+import org.apache.ws.commons.soap.SOAPFactory;
 import org.w3c.dom.Document;
 import org.w3c.dom.Node;
 
@@ -154,7 +155,8 @@
     public SOAPHeader addHeader() throws SOAPException {
         org.apache.ws.commons.soap.SOAPHeader header = omSOAPEnvelope.getHeader();
         if (header == null) {
-            header = new SOAP11HeaderImpl(omSOAPEnvelope);
+            header = new SOAP11HeaderImpl(omSOAPEnvelope,
+                    (SOAPFactory) this.element.getOMFactory());
             SOAPHeaderImpl saajSOAPHeader = new SOAPHeaderImpl(header);
             saajSOAPHeader.setParentElement(this);
             ((NodeImpl) omSOAPEnvelope.getHeader()).setUserData(SAAJ_NODE, saajSOAPHeader, null);
@@ -183,7 +185,7 @@
     public SOAPBody addBody() throws SOAPException {
         org.apache.ws.commons.soap.SOAPBody body = omSOAPEnvelope.getBody();
         if (body == null) {
-            body = new SOAP11BodyImpl(omSOAPEnvelope);
+            body = new SOAP11BodyImpl(omSOAPEnvelope, (SOAPFactory)this.element.getOMFactory());
             SOAPBodyImpl saajSOAPBody = new SOAPBodyImpl(body);
             saajSOAPBody.setParentElement(this);
             ((NodeImpl) omSOAPEnvelope.getBody()).setUserData(SAAJ_NODE, saajSOAPBody, null);
@@ -203,7 +205,7 @@
         } else {
 
             // Else this is a header
-            TextImpl doomText = new TextImpl(text);
+            TextImpl doomText = new TextImpl(text, this.element.getOMFactory());
             doomText.setNextOMSibling((NodeImpl) firstChild);
             doomText.setPreviousOMSibling(null);
             element.setFirstChild(doomText);

Modified: webservices/axis2/trunk/java/modules/saaj/src/org/apache/axis2/saaj/SOAPFactoryImpl.java
URL: http://svn.apache.org/viewcvs/webservices/axis2/trunk/java/modules/saaj/src/org/apache/axis2/saaj/SOAPFactoryImpl.java?rev=383807&r1=383806&r2=383807&view=diff
==============================================================================
--- webservices/axis2/trunk/java/modules/saaj/src/org/apache/axis2/saaj/SOAPFactoryImpl.java (original)
+++ webservices/axis2/trunk/java/modules/saaj/src/org/apache/axis2/saaj/SOAPFactoryImpl.java Mon Mar  6 23:05:35 2006
@@ -104,7 +104,7 @@
      * @return a <code>Detail</code> object
      * @throws javax.xml.soap.SOAPException if there is a SOAP error
      */
-    public Detail createDetail() throws SOAPException {
+    public Detail createDetail() throws SOAPException { 
         return new DetailImpl(DOOMAbstractFactory.getSOAP11Factory().createSOAPFaultDetail());
     }
 

Modified: webservices/axis2/trunk/java/modules/saaj/src/org/apache/axis2/saaj/SOAPFaultImpl.java
URL: http://svn.apache.org/viewcvs/webservices/axis2/trunk/java/modules/saaj/src/org/apache/axis2/saaj/SOAPFaultImpl.java?rev=383807&r1=383806&r2=383807&view=diff
==============================================================================
--- webservices/axis2/trunk/java/modules/saaj/src/org/apache/axis2/saaj/SOAPFaultImpl.java (original)
+++ webservices/axis2/trunk/java/modules/saaj/src/org/apache/axis2/saaj/SOAPFaultImpl.java Mon Mar  6 23:05:35 2006
@@ -7,6 +7,7 @@
 import org.apache.axis2.soap.impl.dom.soap11.SOAP11FaultReasonImpl;
 import org.apache.axis2.soap.impl.dom.soap11.SOAP11FaultRoleImpl;
 import org.apache.axis2.soap.impl.dom.soap11.SOAP11FaultTextImpl;
+import org.apache.ws.commons.soap.SOAPFactory;
 import org.apache.ws.commons.soap.SOAPFaultCode;
 import org.apache.ws.commons.soap.SOAPFaultReason;
 import org.apache.ws.commons.soap.SOAPFaultRole;
@@ -84,7 +85,8 @@
       */
     public void setFaultActor(String faultActor) throws SOAPException {
         if (this.fault.getRole() == null) {
-            SOAP11FaultRoleImpl faultRoleImpl = new SOAP11FaultRoleImpl(this.fault);
+            SOAP11FaultRoleImpl faultRoleImpl = new SOAP11FaultRoleImpl(
+                    this.fault, (SOAPFactory) this.element.getOMFactory());
             faultRoleImpl.setRoleValue(faultActor);
             this.fault.setRole(faultRoleImpl);
         } else {
@@ -121,7 +123,8 @@
                 reason.getSOAPText().getFirstOMChild().detach();
                 reason.getSOAPText().setText(faultString);
             } else {
-                SOAPFaultText text = new SOAP11FaultTextImpl(reason);
+                SOAPFaultText text = new SOAP11FaultTextImpl(reason,
+                        (SOAPFactory) this.element.getOMFactory());
                 text.setText(faultString);
                 reason.setSOAPText(text);
             }
@@ -168,7 +171,8 @@
                                     "Please remove the existing Detail element before " +
                                     "calling addDetail()");
         }
-        SOAP11FaultDetailImpl omDetail = new SOAP11FaultDetailImpl(this.fault);
+        SOAP11FaultDetailImpl omDetail = new SOAP11FaultDetailImpl(this.fault,
+                (SOAPFactory) this.element.getOMFactory());
         Detail saajDetail = new DetailImpl(omDetail);
         ((NodeImpl) fault.getDetail()).setUserData(SAAJ_NODE, saajDetail, null);
         isDetailAdded = true;
@@ -192,14 +196,17 @@
                 reason.getSOAPText().setText(faultString);
                 reason.getSOAPText().setLang(locale.getLanguage());
             } else {
-                SOAPFaultText text = new SOAP11FaultTextImpl(reason);
+                SOAPFaultText text = new SOAP11FaultTextImpl(reason,
+                        (SOAPFactory) this.element.getOMFactory());
                 text.setText(faultString);
                 text.setLang(locale.getLanguage());
                 reason.setSOAPText(text);
             }
         } else {
-            SOAPFaultReason reason = new SOAP11FaultReasonImpl(this.fault);
-            SOAPFaultText text = new SOAP11FaultTextImpl(reason);
+            SOAPFaultReason reason = new SOAP11FaultReasonImpl(this.fault,
+                    (SOAPFactory) this.element.getOMFactory());
+            SOAPFaultText text = new SOAP11FaultTextImpl(reason,
+                    (SOAPFactory) this.element.getOMFactory());
             text.setText(faultString);
             text.setLang(locale.getLanguage());
             reason.setSOAPText(text);

Modified: webservices/axis2/trunk/java/modules/saaj/src/org/apache/axis2/saaj/SOAPHeaderImpl.java
URL: http://svn.apache.org/viewcvs/webservices/axis2/trunk/java/modules/saaj/src/org/apache/axis2/saaj/SOAPHeaderImpl.java?rev=383807&r1=383806&r2=383807&view=diff
==============================================================================
--- webservices/axis2/trunk/java/modules/saaj/src/org/apache/axis2/saaj/SOAPHeaderImpl.java (original)
+++ webservices/axis2/trunk/java/modules/saaj/src/org/apache/axis2/saaj/SOAPHeaderImpl.java Mon Mar  6 23:05:35 2006
@@ -21,6 +21,7 @@
 import org.apache.axis2.soap.impl.dom.soap11.SOAP11HeaderBlockImpl;
 import org.apache.ws.commons.om.OMNamespace;
 import org.apache.ws.commons.om.OMNode;
+import org.apache.ws.commons.soap.SOAPFactory;
 import org.apache.ws.commons.soap.SOAPHeaderBlock;
 
 import javax.xml.namespace.QName;
@@ -71,9 +72,9 @@
     * @see javax.xml.soap.SOAPElement#addChildElement(java.lang.String, java.lang.String, java.lang.String)
     */
     public SOAPElement addChildElement(String localName, String prefix, String uri) throws SOAPException {
-        OMNamespace ns = new NamespaceImpl(uri, prefix);
+        OMNamespace ns = new NamespaceImpl(uri, prefix, this.element.getOMFactory());
         SOAPHeaderBlock headerBlock =
-                new SOAP11HeaderBlockImpl(localName, ns, omSOAPHeader);
+                new SOAP11HeaderBlockImpl(localName, ns, omSOAPHeader, (SOAPFactory)this.element.getOMFactory());
         SOAPHeaderElementImpl soapHeaderElement = new SOAPHeaderElementImpl(headerBlock);
         element.setUserData(SAAJ_NODE, this, null);
         soapHeaderElement.element.setUserData(SAAJ_NODE, soapHeaderElement, null);
@@ -92,9 +93,13 @@
     * @see javax.xml.soap.SOAPElement#addChildElement(javax.xml.soap.SOAPElement)
     */
     public SOAPElement addChildElement(SOAPElement soapElement) throws SOAPException {
-        OMNamespace ns = new NamespaceImpl(soapElement.getNamespaceURI(), soapElement.getPrefix());
+        OMNamespace ns = new NamespaceImpl(soapElement.getNamespaceURI(), 
+                soapElement.getPrefix(),
+                (SOAPFactory)this.element.getOMFactory());
         SOAPHeaderBlock headerBlock =
-                new SOAP11HeaderBlockImpl(soapElement.getLocalName(), ns, omSOAPHeader);
+                new SOAP11HeaderBlockImpl(soapElement.getLocalName(), ns, 
+                        omSOAPHeader,
+                        (SOAPFactory)this.element.getOMFactory());
         SOAPHeaderElementImpl soapHeaderElement = new SOAPHeaderElementImpl(headerBlock);
         element.setUserData(SAAJ_NODE, this, null);
         soapHeaderElement.element.setUserData(SAAJ_NODE, soapHeaderElement, null);
@@ -116,9 +121,11 @@
      * @throws SOAPException if a SOAP error occurs
      */
     public SOAPHeaderElement addHeaderElement(Name name) throws SOAPException {
-        OMNamespace ns = new NamespaceImpl(name.getURI(), name.getPrefix());
+        OMNamespace ns = new NamespaceImpl(name.getURI(), name.getPrefix(), 
+                (SOAPFactory)this.element.getOMFactory());
         SOAPHeaderBlock headerBlock =
-                new SOAP11HeaderBlockImpl(name.getLocalName(), ns, omSOAPHeader);
+                new SOAP11HeaderBlockImpl(name.getLocalName(), ns, omSOAPHeader,
+                        (SOAPFactory)this.element.getOMFactory());
         SOAPHeaderElementImpl soapHeaderElement = new SOAPHeaderElementImpl(headerBlock);
         element.setUserData(SAAJ_NODE, this, null);
         soapHeaderElement.element.setUserData(SAAJ_NODE, soapHeaderElement, null);

Modified: webservices/axis2/trunk/java/modules/saaj/src/org/apache/axis2/saaj/TextImplEx.java
URL: http://svn.apache.org/viewcvs/webservices/axis2/trunk/java/modules/saaj/src/org/apache/axis2/saaj/TextImplEx.java?rev=383807&r1=383806&r2=383807&view=diff
==============================================================================
--- webservices/axis2/trunk/java/modules/saaj/src/org/apache/axis2/saaj/TextImplEx.java (original)
+++ webservices/axis2/trunk/java/modules/saaj/src/org/apache/axis2/saaj/TextImplEx.java Mon Mar  6 23:05:35 2006
@@ -15,6 +15,10 @@
  */
 package org.apache.axis2.saaj;
 
+import javax.xml.soap.SOAPElement;
+import javax.xml.soap.Text;
+import javax.xml.stream.XMLStreamException;
+
 import org.apache.axis2.om.DOOMAbstractFactory;
 import org.apache.axis2.om.impl.dom.TextImpl;
 import org.apache.ws.commons.om.OMContainer;
@@ -22,12 +26,6 @@
 import org.apache.ws.commons.om.impl.OMOutputImpl;
 import org.w3c.dom.DOMException;
 
-import javax.xml.soap.Text;
-import javax.xml.soap.SOAPElement;
-import javax.xml.soap.Node;
-import javax.xml.stream.XMLStreamException;
-import java.util.Iterator;
-
 public class TextImplEx extends NodeImplEx implements Text {
 
     //TODO: assign textNode
@@ -38,12 +36,14 @@
     private org.w3c.dom.Node nextSibling;
 
     public TextImplEx(String data, SOAPElement parent) {
+        super(((SOAPElementImpl)parent).getOMFactory());
         textNode = (TextImpl) DOOMAbstractFactory.getOMFactory().createText(data);
         this.parentElement = parent;
     }
 
     public TextImplEx(String data, SOAPElement parent,
                       org.w3c.dom.Node prevSibling, org.w3c.dom.Node nextSibling) {
+        super(((SOAPElementImpl)parent).getOMFactory());
         textNode = (TextImpl) DOOMAbstractFactory.getOMFactory().createText(data);
         this.parentElement = parent;
         this.previousSibling = prevSibling;

Modified: webservices/axis2/trunk/java/modules/security/src/org/apache/axis2/security/WSDoAllReceiver.java
URL: http://svn.apache.org/viewcvs/webservices/axis2/trunk/java/modules/security/src/org/apache/axis2/security/WSDoAllReceiver.java?rev=383807&r1=383806&r2=383807&view=diff
==============================================================================
--- webservices/axis2/trunk/java/modules/security/src/org/apache/axis2/security/WSDoAllReceiver.java (original)
+++ webservices/axis2/trunk/java/modules/security/src/org/apache/axis2/security/WSDoAllReceiver.java Mon Mar  6 23:05:35 2006
@@ -17,6 +17,7 @@
 package org.apache.axis2.security;
 
 import org.apache.axis2.AxisFault;
+import org.apache.axis2.Constants;
 import org.apache.axis2.context.MessageContext;
 import org.apache.axis2.context.OperationContext;
 import org.apache.axis2.om.impl.dom.DocumentImpl;
@@ -63,12 +64,17 @@
         
         boolean doDebug = log.isDebugEnabled();
         
-        /**
-         * Temporary solution until DOOM's DocumentBuilder module is done.
-         * Use ThreadLocal to determine whether or not DOOM implementation is required.
-         */
-        // Set the DOM impl to DOOM
-        DocumentBuilderFactoryImpl.setDOOMRequired(true);
+        String disableDoomValue = (String)msgContext.getProperty(WSSHandlerConstants.DISABLE_DOOM);
+        boolean disableDoom = disableDoomValue != null && Constants.VALUE_TRUE.equalsIgnoreCase(disableDoomValue);
+        
+        if(!disableDoom) {
+            /**
+             * Temporary solution until DOOM's DocumentBuilder module is done.
+             * Use ThreadLocal to determine whether or not DOOM implementation is required.
+             */
+            // Set the DOM impl to DOOM
+            DocumentBuilderFactoryImpl.setDOOMRequired(true);
+        }
         
         try {
             //populate the properties
@@ -115,7 +121,7 @@
             Document doc = null;
             
             try {
-                doc = Axis2Util.getDocumentFromSOAPEnvelope(msgContext.getEnvelope());
+                doc = Axis2Util.getDocumentFromSOAPEnvelope(msgContext.getEnvelope(), disableDoom);
             } catch (WSSecurityException wssEx) {
                 throw new AxisFault("WSDoAllReceiver: Error in converting to Document", wssEx);
             }
@@ -190,14 +196,9 @@
             /**
              * Set the new SOAPEnvelope
              */
-//          
-//          log.debug("Creating LLOM Structure");
-//          OMElement docElem = (OMElement)doc.getDocumentElement();
-//          StAXSOAPModelBuilder stAXSOAPModelBuilder = new StAXSOAPModelBuilder(docElem.getXMLStreamReader(), SOAP11Constants.SOAP_ENVELOPE_NAMESPACE_URI);
-//          log.debug("Creating LLOM Structure - DONE");
-//          msgContext.setEnvelope((stAXSOAPModelBuilder).getSOAPEnvelope());
+
             
-            msgContext.setEnvelope(Axis2Util.getSOAPEnvelopeFromDOOMDocument((DocumentImpl)doc));
+            msgContext.setEnvelope(Axis2Util.getSOAPEnvelopeFromDOOMDocument(doc, disableDoom));
             
             /*
              * After setting the new current message, probably modified because

Modified: webservices/axis2/trunk/java/modules/security/src/org/apache/axis2/security/WSDoAllSender.java
URL: http://svn.apache.org/viewcvs/webservices/axis2/trunk/java/modules/security/src/org/apache/axis2/security/WSDoAllSender.java?rev=383807&r1=383806&r2=383807&view=diff
==============================================================================
--- webservices/axis2/trunk/java/modules/security/src/org/apache/axis2/security/WSDoAllSender.java (original)
+++ webservices/axis2/trunk/java/modules/security/src/org/apache/axis2/security/WSDoAllSender.java Mon Mar  6 23:05:35 2006
@@ -16,10 +16,12 @@
 
 package org.apache.axis2.security;
 
+import java.util.Vector;
+
 import org.apache.axis2.AxisFault;
+import org.apache.axis2.Constants;
 import org.apache.axis2.context.MessageContext;
 import org.apache.axis2.context.OperationContext;
-import org.apache.axis2.om.impl.dom.DocumentImpl;
 import org.apache.axis2.om.impl.dom.jaxp.DocumentBuilderFactoryImpl;
 import org.apache.axis2.security.handler.WSDoAllHandler;
 import org.apache.axis2.security.handler.WSSHandlerConstants;
@@ -28,7 +30,6 @@
 import org.apache.axis2.security.util.MessageOptimizer;
 import org.apache.commons.logging.Log;
 import org.apache.commons.logging.LogFactory;
-import org.apache.ws.commons.soap.SOAPEnvelope;
 import org.apache.ws.security.WSConstants;
 import org.apache.ws.security.WSSecurityException;
 import org.apache.ws.security.handler.RequestData;
@@ -37,8 +38,6 @@
 import org.apache.wsdl.WSDLConstants;
 import org.w3c.dom.Document;
 
-import java.util.Vector;
-
 public class WSDoAllSender extends WSDoAllHandler {
     
     private static final long serialVersionUID = 3016802164501419165L;
@@ -58,13 +57,17 @@
     
     public void invoke(MessageContext msgContext) throws AxisFault {
         
-        /**
-         * Temporary solution until DOOM's DocumentBuilder module is done.
-         * Use ThreadLocal to determine whether or not DOOM implementation is required.
-         */
-        // Set the DOM impl to DOOM
-        DocumentBuilderFactoryImpl.setDOOMRequired(true);
+        String disableDoomValue = (String)msgContext.getProperty(WSSHandlerConstants.DISABLE_DOOM);
+        boolean disableDoom = disableDoomValue != null && Constants.VALUE_TRUE.equalsIgnoreCase(disableDoomValue);
         
+        if(!disableDoom) {
+            /**
+             * Temporary solution until DOOM's DocumentBuilder module is done.
+             * Use ThreadLocal to determine whether or not DOOM implementation is required.
+             */
+            // Set the DOM impl to DOOM
+            DocumentBuilderFactoryImpl.setDOOMRequired(true);
+        }
         
         try {
             boolean doDebug = log.isDebugEnabled();
@@ -166,7 +169,7 @@
             if ((doc = (Document) ((MessageContext)reqData.getMsgContext())
                     .getProperty(WSHandlerConstants.SND_SECURITY)) == null) {
                 try {
-                    doc = Axis2Util.getDocumentFromSOAPEnvelope(msgContext.getEnvelope());
+                    doc = Axis2Util.getDocumentFromSOAPEnvelope(msgContext.getEnvelope(), disableDoom);
                 } catch (WSSecurityException wssEx) {
                     throw new AxisFault("WSDoAllReceiver: Error in converting to Document", wssEx);
                 }
@@ -193,26 +196,11 @@
                 ((MessageContext)reqData.getMsgContext()).setProperty(WSHandlerConstants.SND_SECURITY,
                         doc);
             } else {
-                
-                String preserve = null;
-                if ((preserve = (String) getOption(WSSHandlerConstants.PRESERVE_ORIGINAL_ENV)) == null) {
-                    preserve = (String) getProperty(msgContext, WSSHandlerConstants.PRESERVE_ORIGINAL_ENV);
-                }
-                if(preserve != null) {
-                    this.preserveOriginalEnvelope = "true".equalsIgnoreCase(preserve);
-                }
-                
-                msgContext.setEnvelope((SOAPEnvelope)doc.getDocumentElement());
-                
+                msgContext.setEnvelope(Axis2Util.getSOAPEnvelopeFromDOOMDocument(doc, disableDoom));
                 ((MessageContext)reqData.getMsgContext()).setProperty(WSHandlerConstants.SND_SECURITY, null);
             }
             
-//          log.debug("Creating LLOM Structure");
-//          OMElement docElem = (OMElement)doc.getDocumentElement();
-//          StAXSOAPModelBuilder stAXSOAPModelBuilder = new StAXSOAPModelBuilder(docElem.getXMLStreamReader(), SOAP11Constants.SOAP_ENVELOPE_NAMESPACE_URI);
-//          log.debug("Creating LLOM Structure - DONE");
-//          msgContext.setEnvelope(stAXSOAPModelBuilder.getSOAPEnvelope());
-            msgContext.setEnvelope(Axis2Util.getSOAPEnvelopeFromDOOMDocument((DocumentImpl)doc));
+
             /**
              * If the optimizeParts parts are set then optimize them
              */

Modified: webservices/axis2/trunk/java/modules/security/src/org/apache/axis2/security/handler/WSSHandlerConstants.java
URL: http://svn.apache.org/viewcvs/webservices/axis2/trunk/java/modules/security/src/org/apache/axis2/security/handler/WSSHandlerConstants.java?rev=383807&r1=383806&r2=383807&view=diff
==============================================================================
--- webservices/axis2/trunk/java/modules/security/src/org/apache/axis2/security/handler/WSSHandlerConstants.java (original)
+++ webservices/axis2/trunk/java/modules/security/src/org/apache/axis2/security/handler/WSSHandlerConstants.java Mon Mar  6 23:05:35 2006
@@ -77,4 +77,9 @@
     public final static String SIGN_ALL_HEADERS = "signAllHeaders";
     public final static String SIGN_BODY = "signBody";
     public final static String ENCRYPT_BODY = "encryptBody";
+    
+    /**
+     * Key to be used to set a flag in msg ctx to enable/disable using doom
+     */
+    public final static String DISABLE_DOOM = "useDoom";
 }

Modified: webservices/axis2/trunk/java/modules/security/src/org/apache/axis2/security/util/Axis2Util.java
URL: http://svn.apache.org/viewcvs/webservices/axis2/trunk/java/modules/security/src/org/apache/axis2/security/util/Axis2Util.java?rev=383807&r1=383806&r2=383807&view=diff
==============================================================================
--- webservices/axis2/trunk/java/modules/security/src/org/apache/axis2/security/util/Axis2Util.java (original)
+++ webservices/axis2/trunk/java/modules/security/src/org/apache/axis2/security/util/Axis2Util.java Mon Mar  6 23:05:35 2006
@@ -16,9 +16,18 @@
 
 package org.apache.axis2.security.util;
 
+import java.io.ByteArrayInputStream;
+import java.io.ByteArrayOutputStream;
+
+import javax.xml.parsers.DocumentBuilderFactory;
+import javax.xml.stream.FactoryConfigurationError;
+import javax.xml.stream.XMLInputFactory;
+import javax.xml.stream.XMLStreamException;
+import javax.xml.stream.XMLStreamReader;
+
 import org.apache.axis2.om.DOOMAbstractFactory;
-import org.apache.axis2.om.impl.dom.DocumentImpl;
 import org.apache.axis2.security.handler.WSSHandlerConstants;
+import org.apache.axis2.soap.impl.dom.soap11.SOAP11Factory;
 import org.apache.ws.commons.om.OMElement;
 import org.apache.ws.commons.om.impl.llom.builder.StAXOMBuilder;
 import org.apache.ws.commons.soap.SOAP11Constants;
@@ -31,12 +40,6 @@
 import org.w3c.dom.Document;
 import org.w3c.dom.Element;
 
-import javax.xml.parsers.DocumentBuilderFactory;
-import javax.xml.stream.XMLInputFactory;
-import javax.xml.stream.XMLStreamReader;
-import java.io.ByteArrayInputStream;
-import java.io.ByteArrayOutputStream;
-
 /**
  * Utility class for the Axis2-WSS4J Module
  */
@@ -48,39 +51,70 @@
 	 * @return Returns the DOM Document of the given SOAP Envelope.
 	 * @throws Exception
 	 */
-	public static Document getDocumentFromSOAPEnvelope(SOAPEnvelope env)
+	public static Document getDocumentFromSOAPEnvelope(SOAPEnvelope env, boolean disableDoom)
 			throws WSSecurityException {
 		try {
-			env.build();
-			
-			//Check the namespace and find SOAP version and factory
-			String nsURI = null;
-			SOAPFactory factory;
-			if(env.getNamespace().getName().equals(SOAP11Constants.SOAP_ENVELOPE_NAMESPACE_URI)) {
-				nsURI = SOAP11Constants.SOAP_ENVELOPE_NAMESPACE_URI;
-				factory = DOOMAbstractFactory.getSOAP11Factory();
-			} else {
-				nsURI = SOAP12Constants.SOAP_ENVELOPE_NAMESPACE_URI;
-				factory = DOOMAbstractFactory.getSOAP12Factory();
-			}
-			
-			StAXSOAPModelBuilder stAXSOAPModelBuilder = new StAXSOAPModelBuilder(env.getXMLStreamReader(),factory, nsURI);
-			SOAPEnvelope envelope = (stAXSOAPModelBuilder).getSOAPEnvelope();
-			envelope.build();
-			
-			Element envElem = (Element)envelope;
-			return envElem.getOwnerDocument();
-			
+            if(!disableDoom) {
+    			env.build();
+    			
+    			//Check the namespace and find SOAP version and factory
+    			String nsURI = null;
+    			SOAPFactory factory;
+    			if(env.getNamespace().getName().equals(SOAP11Constants.SOAP_ENVELOPE_NAMESPACE_URI)) {
+    				nsURI = SOAP11Constants.SOAP_ENVELOPE_NAMESPACE_URI;
+    				factory = DOOMAbstractFactory.getSOAP11Factory();
+    			} else {
+    				nsURI = SOAP12Constants.SOAP_ENVELOPE_NAMESPACE_URI;
+    				factory = DOOMAbstractFactory.getSOAP12Factory();
+    			}
+    			
+    			StAXSOAPModelBuilder stAXSOAPModelBuilder = new StAXSOAPModelBuilder(env.getXMLStreamReader(),factory, nsURI);
+    			SOAPEnvelope envelope = (stAXSOAPModelBuilder).getSOAPEnvelope();
+    			envelope.build();
+    			
+    			Element envElem = (Element)envelope;
+    			return envElem.getOwnerDocument();
+            } else {
+                ByteArrayOutputStream baos = new ByteArrayOutputStream();
+                env.build();
+                env.serialize(baos);
+                ByteArrayInputStream bais = new ByteArrayInputStream(baos.toByteArray());
+                DocumentBuilderFactory factory = DocumentBuilderFactory.newInstance();
+                factory.setNamespaceAware(true);
+                return factory.newDocumentBuilder().parse(bais);
+            }
 		} catch (Exception e) {
 			throw new WSSecurityException(
 					"Error in converting SOAP Envelope to Document", e);
 		}
 	}
 
-	public static SOAPEnvelope getSOAPEnvelopeFromDOOMDocument(DocumentImpl doc) {
-        OMElement docElem = (OMElement)doc.getDocumentElement();
-        StAXSOAPModelBuilder stAXSOAPModelBuilder = new StAXSOAPModelBuilder(docElem.getXMLStreamReader(), null);
-        return stAXSOAPModelBuilder.getSOAPEnvelope();
+	public static SOAPEnvelope getSOAPEnvelopeFromDOOMDocument(Document doc, boolean disableDoom) {
+        
+        ByteArrayOutputStream os = new ByteArrayOutputStream();
+        XMLUtils.outputDOM(doc, os, true);
+        
+        ByteArrayInputStream bais = new ByteArrayInputStream(os.toByteArray());
+        
+//        OMElement docElem = (OMElement)doc.getDocumentElement();
+        XMLStreamReader reader;
+        try {
+            reader = XMLInputFactory.newInstance().createXMLStreamReader(bais);
+            StAXSOAPModelBuilder stAXSOAPModelBuilder = new StAXSOAPModelBuilder(reader, null);
+            SOAPEnvelope envelope = stAXSOAPModelBuilder.getSOAPEnvelope();
+            envelope.build();
+            return envelope;
+        } catch (XMLStreamException e) {
+            // TODO Auto-generated catch block
+            e.printStackTrace();
+            throw new UnsupportedOperationException("WIP");
+        } catch (FactoryConfigurationError e) {
+            // TODO Auto-generated catch block
+            e.printStackTrace();
+            throw new UnsupportedOperationException("WIP");
+        }
+        
+
 	}
 	
 	



Mime
View raw message