axis-java-dev mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From ruchi...@apache.org
Subject svn commit: r395786 - /webservices/axis2/trunk/java/modules/security/src/org/apache/axis2/security/util/Axis2Util.java
Date Fri, 21 Apr 2006 05:51:53 GMT
Author: ruchithf
Date: Thu Apr 20 22:51:51 2006
New Revision: 395786

URL: http://svn.apache.org/viewcvs?rev=395786&view=rev
Log:
Fix suggested in http://marc.theaimsgroup.com/?l=axis-user&m=114554574620042&w=2 by
Kheng Kok


Modified:
    webservices/axis2/trunk/java/modules/security/src/org/apache/axis2/security/util/Axis2Util.java

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=395786&r1=395785&r2=395786&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
Thu Apr 20 22:51:51 2006
@@ -39,7 +39,6 @@
 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 java.io.ByteArrayInputStream;
@@ -122,33 +121,23 @@
 		}
 	}
 
-	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;
+	public static SOAPEnvelope getSOAPEnvelopeFromDOOMDocument(Document doc)
+            throws WSSecurityException {
+
         try {
-            reader = XMLInputFactory.newInstance().createXMLStreamReader(bais);
-            StAXSOAPModelBuilder stAXSOAPModelBuilder = new StAXSOAPModelBuilder(reader,
null);
+            XMLStreamReader reader = ((OMElement) doc.getDocumentElement())
+                    .getXMLStreamReader();
+            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");
+            throw new WSSecurityException(e.getMessage());
         }
-        
 
-	}
+    }
 	
 	
 	/**



Mime
View raw message