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 di...@apache.org on 2006/05/02 05:38:59 UTC

svn commit: r398793 [1/2] - in /webservices/axis2/trunk/java/modules: adb/src/org/apache/axis2/databinding/utils/ adb/test/org/apache/axis2/databinding/ adb/test/org/apache/axis2/databinding/utils/ adb/test/org/apache/axis2/databinding/utils/reader/ ad...

Author: dims
Date: Mon May  1 20:38:53 2006
New Revision: 398793

URL: http://svn.apache.org/viewcvs?rev=398793&view=rev
Log:
switch to the StAXUtil methods - to cache the XML(In|Out)putFactory instances

Modified:
    webservices/axis2/trunk/java/modules/adb/src/org/apache/axis2/databinding/utils/BeanUtil.java
    webservices/axis2/trunk/java/modules/adb/src/org/apache/axis2/databinding/utils/ConverterUtil.java
    webservices/axis2/trunk/java/modules/adb/test/org/apache/axis2/databinding/ADBSOAPModelBuilderTest.java
    webservices/axis2/trunk/java/modules/adb/test/org/apache/axis2/databinding/utils/NamedStaxOMBuilderTest.java
    webservices/axis2/trunk/java/modules/adb/test/org/apache/axis2/databinding/utils/SimpleArrayReaderStateMachineTest.java
    webservices/axis2/trunk/java/modules/adb/test/org/apache/axis2/databinding/utils/SimpleElementReaderStateMachineTest.java
    webservices/axis2/trunk/java/modules/adb/test/org/apache/axis2/databinding/utils/reader/ADBXMLStreamReaderTest.java
    webservices/axis2/trunk/java/modules/addressing/test/org/apache/axis2/handlers/util/TestUtil.java
    webservices/axis2/trunk/java/modules/codegen/test/org/apache/axis2/schema/populate/derived/AbstractDerivedPopulater.java
    webservices/axis2/trunk/java/modules/codegen/test/org/apache/axis2/schema/populate/other/PopulateAnonComplexTypeTest.java
    webservices/axis2/trunk/java/modules/codegen/test/org/apache/axis2/schema/populate/other/PopulateAnyTypeTest.java
    webservices/axis2/trunk/java/modules/codegen/test/org/apache/axis2/schema/populate/other/PopulateArrayInArrayTest.java
    webservices/axis2/trunk/java/modules/codegen/test/org/apache/axis2/schema/populate/other/PopulateArrayTest.java
    webservices/axis2/trunk/java/modules/codegen/test/org/apache/axis2/schema/populate/other/PopulateChoiceTest.java
    webservices/axis2/trunk/java/modules/codegen/test/org/apache/axis2/schema/populate/other/PopulateComplexMinOccurs0Test.java
    webservices/axis2/trunk/java/modules/codegen/test/org/apache/axis2/schema/populate/other/PopulateMinOccurs0Test.java
    webservices/axis2/trunk/java/modules/codegen/test/org/apache/axis2/schema/populate/other/PopulateMixedMinoccurs0Test.java
    webservices/axis2/trunk/java/modules/codegen/test/org/apache/axis2/schema/populate/other/PopulateRecursiveTest.java
    webservices/axis2/trunk/java/modules/codegen/test/org/apache/axis2/schema/populate/simple/AbstractSimplePopulater.java
    webservices/axis2/trunk/java/modules/core/src/org/apache/axis2/deployment/DescriptionBuilder.java
    webservices/axis2/trunk/java/modules/core/src/org/apache/axis2/description/AxisService2OM.java
    webservices/axis2/trunk/java/modules/core/src/org/apache/axis2/transport/TransportUtils.java
    webservices/axis2/trunk/java/modules/core/src/org/apache/axis2/transport/http/HTTPTransportUtils.java
    webservices/axis2/trunk/java/modules/core/src/org/apache/axis2/transport/http/util/RESTUtil.java
    webservices/axis2/trunk/java/modules/core/src/org/apache/axis2/transport/jms/SimpleJMSWorker.java
    webservices/axis2/trunk/java/modules/core/src/org/apache/axis2/transport/local/LocalTransportReceiver.java
    webservices/axis2/trunk/java/modules/core/src/org/apache/axis2/transport/mail/MailWorker.java
    webservices/axis2/trunk/java/modules/core/src/org/apache/axis2/transport/mail/server/MailSorter.java
    webservices/axis2/trunk/java/modules/core/src/org/apache/axis2/transport/tcp/TCPWorker.java
    webservices/axis2/trunk/java/modules/core/test/org/apache/axis2/transport/tcp/TCPTransportTest.java
    webservices/axis2/trunk/java/modules/integration/itest/org/apache/axis2/rest/GetTest.java
    webservices/axis2/trunk/java/modules/integration/itest/org/apache/axis2/rest/PostTest.java
    webservices/axis2/trunk/java/modules/integration/itest/org/apache/axis2/rest/RESTBasedEchoRawXMLTest.java
    webservices/axis2/trunk/java/modules/integration/itest/org/apache/axis2/rest/RESTGetTest.java
    webservices/axis2/trunk/java/modules/integration/itest/test/interop/sun/complex/SunGroupHMain.java
    webservices/axis2/trunk/java/modules/integration/itest/test/interop/sun/simple/SunGroupHMain.java
    webservices/axis2/trunk/java/modules/integration/src/test/interop/whitemesa/WhiteMesaIneterop.java
    webservices/axis2/trunk/java/modules/integration/src/test/soap12testing/client/MessageComparator.java
    webservices/axis2/trunk/java/modules/integration/src/test/soap12testing/client/SOAPCreater.java
    webservices/axis2/trunk/java/modules/integration/test/org/apache/axis2/engine/FaultHandlingTest.java
    webservices/axis2/trunk/java/modules/integration/test/org/apache/axis2/engine/HandlerFailureTest.java
    webservices/axis2/trunk/java/modules/integration/test/org/apache/axis2/groovy/GroovyServiceTest.java
    webservices/axis2/trunk/java/modules/integration/test/org/apache/axis2/jms/JMSEchoRawXMLTest.java
    webservices/axis2/trunk/java/modules/integration/test/org/apache/axis2/mail/MailRequestResponseRawXMLTest.java
    webservices/axis2/trunk/java/modules/integration/test/org/apache/axis2/mail/MailetRequestResponseRawXMLTest.java
    webservices/axis2/trunk/java/modules/integration/test/org/apache/axis2/mtom/EchoRawMTOMTest.java
    webservices/axis2/trunk/java/modules/integration/test/org/apache/axis2/rpc/MultirefTest.java
    webservices/axis2/trunk/java/modules/integration/test/org/apache/axis2/rpc/RPCCallTest.java
    webservices/axis2/trunk/java/modules/integration/test/org/apache/axis2/security/rahas/TestClient.java
    webservices/axis2/trunk/java/modules/integration/test/org/apache/axis2/tcp/TCPEchoRawXMLTest.java
    webservices/axis2/trunk/java/modules/integration/test/org/apache/axis2/tcp/TCPTwoChannelEchoRawXMLTest.java
    webservices/axis2/trunk/java/modules/java2wsdl/src/org/apache/ws/java2wsdl/Java2OMBuilder.java
    webservices/axis2/trunk/java/modules/jibx/src/org/apache/axis2/jibx/JiBXDataSource.java
    webservices/axis2/trunk/java/modules/saaj/src/org/apache/axis2/saaj/SOAPPartImpl.java
    webservices/axis2/trunk/java/modules/samples/src/sample/groovy/GroovyReceiver.java
    webservices/axis2/trunk/java/modules/security/src/org/apache/axis2/security/util/Axis2Util.java

Modified: webservices/axis2/trunk/java/modules/adb/src/org/apache/axis2/databinding/utils/BeanUtil.java
URL: http://svn.apache.org/viewcvs/webservices/axis2/trunk/java/modules/adb/src/org/apache/axis2/databinding/utils/BeanUtil.java?rev=398793&r1=398792&r2=398793&view=diff
==============================================================================
--- webservices/axis2/trunk/java/modules/adb/src/org/apache/axis2/databinding/utils/BeanUtil.java (original)
+++ webservices/axis2/trunk/java/modules/adb/src/org/apache/axis2/databinding/utils/BeanUtil.java Mon May  1 20:38:53 2006
@@ -516,23 +516,6 @@
         XMLStreamReader xr = new ADBXMLStreamReaderImpl(opName, objects.toArray(), null);
 
         StreamWrapper parser = new StreamWrapper(xr);
-//      /////////////////////////////////////////////////////////////////////////
-//      /////////////////////////////////////////////////////////////////////////
-//        StreamWrapper parser = null;
-//        try {
-//
-//            StreamingOMSerializer ser = new StreamingOMSerializer();
-//            ByteArrayOutputStream byteArrayOutputStream = new ByteArrayOutputStream();
-//            XMLStreamWriter writer = XMLOutputFactory.newInstance().createXMLStreamWriter(System.out);
-//            ser.serialize(
-//                    new StreamWrapper(parser),
-//                    writer);
-//            writer.flush();
-//        } catch (XMLStreamException e) {
-//            e.printStackTrace();  //To change body of catch statement use File | Settings | File Templates.
-//        }
-//
-////       ////////////////////////////////////
         StAXOMBuilder stAXOMBuilder =
                 OMXMLBuilderFactory.createStAXOMBuilder(
                         OMAbstractFactory.getSOAP11Factory(), parser);

Modified: webservices/axis2/trunk/java/modules/adb/src/org/apache/axis2/databinding/utils/ConverterUtil.java
URL: http://svn.apache.org/viewcvs/webservices/axis2/trunk/java/modules/adb/src/org/apache/axis2/databinding/utils/ConverterUtil.java?rev=398793&r1=398792&r2=398793&view=diff
==============================================================================
--- webservices/axis2/trunk/java/modules/adb/src/org/apache/axis2/databinding/utils/ConverterUtil.java (original)
+++ webservices/axis2/trunk/java/modules/adb/src/org/apache/axis2/databinding/utils/ConverterUtil.java Mon May  1 20:38:53 2006
@@ -2,6 +2,7 @@
 
 import org.apache.axiom.om.OMAbstractFactory;
 import org.apache.axiom.om.OMElement;
+import org.apache.axiom.om.util.StAXUtils;
 import org.apache.axiom.om.impl.builder.StAXOMBuilder;
 import org.apache.axiom.attachments.ByteArrayDataSource;
 import org.apache.axis2.databinding.types.Day;
@@ -282,7 +283,7 @@
 
     public static OMElement convertToanyType(String s) {
         try {
-            XMLStreamReader r = XMLInputFactory.newInstance().createXMLStreamReader(
+            XMLStreamReader r = StAXUtils.createXMLStreamReader(
                     new ByteArrayInputStream(s.getBytes()));
             StAXOMBuilder builder = new StAXOMBuilder(OMAbstractFactory.getOMFactory(),r);
             return builder.getDocumentElement();

Modified: webservices/axis2/trunk/java/modules/adb/test/org/apache/axis2/databinding/ADBSOAPModelBuilderTest.java
URL: http://svn.apache.org/viewcvs/webservices/axis2/trunk/java/modules/adb/test/org/apache/axis2/databinding/ADBSOAPModelBuilderTest.java?rev=398793&r1=398792&r2=398793&view=diff
==============================================================================
--- webservices/axis2/trunk/java/modules/adb/test/org/apache/axis2/databinding/ADBSOAPModelBuilderTest.java (original)
+++ webservices/axis2/trunk/java/modules/adb/test/org/apache/axis2/databinding/ADBSOAPModelBuilderTest.java Mon May  1 20:38:53 2006
@@ -18,6 +18,7 @@
 
 import org.apache.axiom.om.OMAbstractFactory;
 import org.apache.axiom.om.OMElement;
+import org.apache.axiom.om.util.StAXUtils;
 import org.apache.axiom.om.impl.dom.DOOMAbstractFactory;
 import org.apache.axiom.soap.SOAP11Constants;
 import org.apache.axiom.soap.SOAPEnvelope;
@@ -103,7 +104,7 @@
 
         String s2 = writer.toString();
 
-        XMLStreamReader r = XMLInputFactory.newInstance().createXMLStreamReader(new StringReader(s2));
+        XMLStreamReader r = StAXUtils.createXMLStreamReader(new StringReader(s2));
         PrintEvents.print(r);
 
         assertXMLEqual(s2,xml);
@@ -148,7 +149,7 @@
         envelope.serialize(writer);
         writer.flush();
 
-        XMLStreamReader r = XMLInputFactory.newInstance().createXMLStreamReader(new StringReader(writer.toString()));
+        XMLStreamReader r = StAXUtils.createXMLStreamReader(new StringReader(writer.toString()));
         PrintEvents.print(r);
 
         //TODO: FIXME. Simpler test in testPrintEvents2

Modified: webservices/axis2/trunk/java/modules/adb/test/org/apache/axis2/databinding/utils/NamedStaxOMBuilderTest.java
URL: http://svn.apache.org/viewcvs/webservices/axis2/trunk/java/modules/adb/test/org/apache/axis2/databinding/utils/NamedStaxOMBuilderTest.java?rev=398793&r1=398792&r2=398793&view=diff
==============================================================================
--- webservices/axis2/trunk/java/modules/adb/test/org/apache/axis2/databinding/utils/NamedStaxOMBuilderTest.java (original)
+++ webservices/axis2/trunk/java/modules/adb/test/org/apache/axis2/databinding/utils/NamedStaxOMBuilderTest.java Mon May  1 20:38:53 2006
@@ -2,6 +2,7 @@
 
 import junit.framework.TestCase;
 import org.apache.axiom.om.OMElement;
+import org.apache.axiom.om.util.StAXUtils;
 import org.apache.axis2.util.StreamWrapper;
 
 import javax.xml.namespace.QName;
@@ -29,7 +30,7 @@
     public void testNamedOMBuilder() throws Exception{
 
         String xmlDoc="<wrapper><myIntVal>200</myIntVal></wrapper>";
-        XMLStreamReader reader = XMLInputFactory.newInstance().createXMLStreamReader(
+        XMLStreamReader reader = StAXUtils.createXMLStreamReader(
                 new StringReader(xmlDoc));
 
         NamedStaxOMBuilder  sm = new NamedStaxOMBuilder(reader,new QName("wrapper"));
@@ -46,7 +47,7 @@
     public void testNamedOMBuilder1() throws Exception{
 
         String xmlDoc="<wrapper><myIntVal>200</myIntVal></wrapper>";
-        XMLStreamReader reader = XMLInputFactory.newInstance().createXMLStreamReader(
+        XMLStreamReader reader = StAXUtils.createXMLStreamReader(
                 new StringReader(xmlDoc));
 
         //move upto the  myIntVal start element first

Modified: webservices/axis2/trunk/java/modules/adb/test/org/apache/axis2/databinding/utils/SimpleArrayReaderStateMachineTest.java
URL: http://svn.apache.org/viewcvs/webservices/axis2/trunk/java/modules/adb/test/org/apache/axis2/databinding/utils/SimpleArrayReaderStateMachineTest.java?rev=398793&r1=398792&r2=398793&view=diff
==============================================================================
--- webservices/axis2/trunk/java/modules/adb/test/org/apache/axis2/databinding/utils/SimpleArrayReaderStateMachineTest.java (original)
+++ webservices/axis2/trunk/java/modules/adb/test/org/apache/axis2/databinding/utils/SimpleArrayReaderStateMachineTest.java Mon May  1 20:38:53 2006
@@ -8,6 +8,8 @@
 import javax.xml.stream.XMLStreamException;
 import javax.xml.stream.XMLStreamReader;
 import java.io.StringReader;
+
+import org.apache.axiom.om.util.StAXUtils;
 /*
  * Copyright 2004,2005 The Apache Software Foundation.
  *
@@ -29,7 +31,7 @@
     public void testStateMachine() throws Exception{
         String xmlDoc="<wrapper><myIntVal>200</myIntVal><myIntVal>200</myIntVal><myIntVal>200</myIntVal>" +
                 "<myIntVal>200</myIntVal><myIntVal>200</myIntVal><myIntVal>200</myIntVal></wrapper>";
-        XMLStreamReader reader = XMLInputFactory.newInstance().createXMLStreamReader(
+        XMLStreamReader reader = StAXUtils.createXMLStreamReader(
                 new StringReader(xmlDoc));
         SimpleArrayReaderStateMachine  sm = new SimpleArrayReaderStateMachine();
         sm.setElementNameToTest(new QName("myIntVal"));
@@ -46,7 +48,7 @@
     public void testStateMachine3() throws Exception{
         String xmlDoc="<wrapper><myIntVal>200</myIntVal><myIntVal>200</myIntVal><myIntVal>200</myIntVal>" +
                 "<myIntVal>200</myIntVal><myIntVal>200</myIntVal><myIntVal>200</myIntVal></wrapper>";
-        XMLStreamReader reader = XMLInputFactory.newInstance().createXMLStreamReader(
+        XMLStreamReader reader = StAXUtils.createXMLStreamReader(
                 new StringReader(xmlDoc));
 
         while(reader.hasNext()){
@@ -71,7 +73,7 @@
 
     public void testStateMachine2() throws Exception{
         String xmlDoc="<wrapper><myIntVal>200</myIntVal></wrapper>";
-        XMLStreamReader reader = XMLInputFactory.newInstance().createXMLStreamReader(
+        XMLStreamReader reader = StAXUtils.createXMLStreamReader(
                 new StringReader(xmlDoc));
         SimpleArrayReaderStateMachine  sm = new SimpleArrayReaderStateMachine();
         sm.setElementNameToTest(new QName("myIntVal"));
@@ -86,7 +88,7 @@
 
      public void testStateMachineEmptyArray() throws Exception{
         String xmlDoc="<wrapper></wrapper>";
-        XMLStreamReader reader = XMLInputFactory.newInstance().createXMLStreamReader(
+        XMLStreamReader reader = StAXUtils.createXMLStreamReader(
                 new StringReader(xmlDoc));
         SimpleArrayReaderStateMachine  sm = new SimpleArrayReaderStateMachine();
         sm.setElementNameToTest(new QName("myIntVal"));

Modified: webservices/axis2/trunk/java/modules/adb/test/org/apache/axis2/databinding/utils/SimpleElementReaderStateMachineTest.java
URL: http://svn.apache.org/viewcvs/webservices/axis2/trunk/java/modules/adb/test/org/apache/axis2/databinding/utils/SimpleElementReaderStateMachineTest.java?rev=398793&r1=398792&r2=398793&view=diff
==============================================================================
--- webservices/axis2/trunk/java/modules/adb/test/org/apache/axis2/databinding/utils/SimpleElementReaderStateMachineTest.java (original)
+++ webservices/axis2/trunk/java/modules/adb/test/org/apache/axis2/databinding/utils/SimpleElementReaderStateMachineTest.java Mon May  1 20:38:53 2006
@@ -7,6 +7,8 @@
 import javax.xml.stream.XMLStreamException;
 import javax.xml.stream.XMLStreamReader;
 import java.io.StringReader;
+
+import org.apache.axiom.om.util.StAXUtils;
 /*
  * Copyright 2004,2005 The Apache Software Foundation.
  *
@@ -27,7 +29,7 @@
 
     public void testStateMachine() throws Exception{
         String xmlDoc="<myIntVal>200</myIntVal>";
-        XMLStreamReader reader = XMLInputFactory.newInstance().createXMLStreamReader(
+        XMLStreamReader reader = StAXUtils.createXMLStreamReader(
                 new StringReader(xmlDoc));
         SimpleElementReaderStateMachine  sm = new SimpleElementReaderStateMachine();
         sm.setElementNameToTest(new QName("myIntVal"));
@@ -42,7 +44,7 @@
 
      public void testStateMachine2() throws Exception{
         String xmlDoc="<wrapper><myIntVal>200</myIntVal></wrapper>";
-        XMLStreamReader reader = XMLInputFactory.newInstance().createXMLStreamReader(
+        XMLStreamReader reader = StAXUtils.createXMLStreamReader(
                 new StringReader(xmlDoc));
         SimpleElementReaderStateMachine  sm = new SimpleElementReaderStateMachine();
         sm.setElementNameToTest(new QName("myIntVal"));
@@ -57,7 +59,7 @@
 
      public void testStateMachine3() throws Exception{
         String xmlDoc="<myIntVal>200<a/></myIntVal>";
-        XMLStreamReader reader = XMLInputFactory.newInstance().createXMLStreamReader(
+        XMLStreamReader reader = StAXUtils.createXMLStreamReader(
                 new StringReader(xmlDoc));
         SimpleElementReaderStateMachine  sm = new SimpleElementReaderStateMachine();
         sm.setElementNameToTest(new QName("myIntVal"));

Modified: webservices/axis2/trunk/java/modules/adb/test/org/apache/axis2/databinding/utils/reader/ADBXMLStreamReaderTest.java
URL: http://svn.apache.org/viewcvs/webservices/axis2/trunk/java/modules/adb/test/org/apache/axis2/databinding/utils/reader/ADBXMLStreamReaderTest.java?rev=398793&r1=398792&r2=398793&view=diff
==============================================================================
--- webservices/axis2/trunk/java/modules/adb/test/org/apache/axis2/databinding/utils/reader/ADBXMLStreamReaderTest.java (original)
+++ webservices/axis2/trunk/java/modules/adb/test/org/apache/axis2/databinding/utils/reader/ADBXMLStreamReaderTest.java Mon May  1 20:38:53 2006
@@ -10,6 +10,7 @@
 import org.apache.axiom.om.OMAttribute;
 import org.apache.axiom.om.OMNamespace;
 import org.apache.axiom.om.OMElement;
+import org.apache.axiom.om.util.StAXUtils;
 import org.apache.axiom.om.impl.serialize.StreamingOMSerializer;
 import org.apache.axiom.attachments.ByteArrayDataSource;
 import org.xml.sax.SAXException;
@@ -812,7 +813,7 @@
 
         StreamingOMSerializer ser = new StreamingOMSerializer();
         ByteArrayOutputStream byteArrayOutputStream = new ByteArrayOutputStream();
-        XMLStreamWriter writer = XMLOutputFactory.newInstance().createXMLStreamWriter(byteArrayOutputStream);
+        XMLStreamWriter writer = StAXUtils.createXMLStreamWriter(byteArrayOutputStream);
         ser.serialize(
                 new StreamWrapper(reader),
                 writer);

Modified: webservices/axis2/trunk/java/modules/addressing/test/org/apache/axis2/handlers/util/TestUtil.java
URL: http://svn.apache.org/viewcvs/webservices/axis2/trunk/java/modules/addressing/test/org/apache/axis2/handlers/util/TestUtil.java?rev=398793&r1=398792&r2=398793&view=diff
==============================================================================
--- webservices/axis2/trunk/java/modules/addressing/test/org/apache/axis2/handlers/util/TestUtil.java (original)
+++ webservices/axis2/trunk/java/modules/addressing/test/org/apache/axis2/handlers/util/TestUtil.java Mon May  1 20:38:53 2006
@@ -17,6 +17,7 @@
 package org.apache.axis2.handlers.util;
 
 import org.apache.axiom.soap.impl.builder.StAXSOAPModelBuilder;
+import org.apache.axiom.om.util.StAXUtils;
 
 import javax.xml.stream.XMLInputFactory;
 import javax.xml.stream.XMLStreamReader;
@@ -34,7 +35,7 @@
         if ("".equals(fileName) || fileName == null) {
             fileName = IN_FILE_NAME;
         }
-        XMLStreamReader parser = XMLInputFactory.newInstance()
+        XMLStreamReader parser = StAXUtils
                 .createXMLStreamReader(
                         new FileReader(getTestResourceFile(fileName)));
         builder = new StAXSOAPModelBuilder(parser, null);

Modified: webservices/axis2/trunk/java/modules/codegen/test/org/apache/axis2/schema/populate/derived/AbstractDerivedPopulater.java
URL: http://svn.apache.org/viewcvs/webservices/axis2/trunk/java/modules/codegen/test/org/apache/axis2/schema/populate/derived/AbstractDerivedPopulater.java?rev=398793&r1=398792&r2=398793&view=diff
==============================================================================
--- webservices/axis2/trunk/java/modules/codegen/test/org/apache/axis2/schema/populate/derived/AbstractDerivedPopulater.java (original)
+++ webservices/axis2/trunk/java/modules/codegen/test/org/apache/axis2/schema/populate/derived/AbstractDerivedPopulater.java Mon May  1 20:38:53 2006
@@ -9,6 +9,8 @@
 import java.beans.PropertyDescriptor;
 import java.io.ByteArrayInputStream;
 import java.lang.reflect.Method;
+
+import org.apache.axiom.om.util.StAXUtils;
 /*
  * Copyright 2004,2005 The Apache Software Foundation.
  *
@@ -32,7 +34,7 @@
 
     // Simple reusable method to make object instances via reflection
     protected Object process(String testString,String className) throws Exception{
-        XMLStreamReader reader = XMLInputFactory.newInstance().createXMLStreamReader(new ByteArrayInputStream(testString.getBytes()));
+        XMLStreamReader reader = StAXUtils.createXMLStreamReader(new ByteArrayInputStream(testString.getBytes()));
         Class clazz = Class.forName(className);
         Class[] declaredClasse = clazz.getDeclaredClasses();
         //ideally this should be 1

Modified: webservices/axis2/trunk/java/modules/codegen/test/org/apache/axis2/schema/populate/other/PopulateAnonComplexTypeTest.java
URL: http://svn.apache.org/viewcvs/webservices/axis2/trunk/java/modules/codegen/test/org/apache/axis2/schema/populate/other/PopulateAnonComplexTypeTest.java?rev=398793&r1=398792&r2=398793&view=diff
==============================================================================
--- webservices/axis2/trunk/java/modules/codegen/test/org/apache/axis2/schema/populate/other/PopulateAnonComplexTypeTest.java (original)
+++ webservices/axis2/trunk/java/modules/codegen/test/org/apache/axis2/schema/populate/other/PopulateAnonComplexTypeTest.java Mon May  1 20:38:53 2006
@@ -10,22 +10,23 @@
 import java.io.ByteArrayInputStream;
 import java.lang.reflect.Method;
 
+import org.apache.axiom.om.util.StAXUtils;
 
 /*
- * Copyright 2004,2005 The Apache Software Foundation.
- *
- * Licensed under the Apache License, Version 2.0 (the "License");
- * you may not use this file except in compliance with the License.
- * You may obtain a copy of the License at
- *
- *      http://www.apache.org/licenses/LICENSE-2.0
- *
- * Unless required by applicable law or agreed to in writing, software
- * distributed under the License is distributed on an "AS IS" BASIS,
- * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
- * See the License for the specific language governing permissions and
- * limitations under the License.
- */
+* Copyright 2004,2005 The Apache Software Foundation.
+*
+* Licensed under the Apache License, Version 2.0 (the "License");
+* you may not use this file except in compliance with the License.
+* You may obtain a copy of the License at
+*
+*      http://www.apache.org/licenses/LICENSE-2.0
+*
+* Unless required by applicable law or agreed to in writing, software
+* distributed under the License is distributed on an "AS IS" BASIS,
+* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+* See the License for the specific language governing permissions and
+* limitations under the License.
+*/
 
 public class PopulateAnonComplexTypeTest extends TestCase {
     private String xmlString = "<tempElt xmlns=\"http://soapinterop.org1/types\">" +
@@ -36,7 +37,7 @@
 
     public void testPopulate() throws Exception{
 
-        XMLStreamReader reader = XMLInputFactory.newInstance().createXMLStreamReader(new ByteArrayInputStream(xmlString.getBytes()));
+        XMLStreamReader reader = StAXUtils.createXMLStreamReader(new ByteArrayInputStream(xmlString.getBytes()));
         Class clazz = Class.forName("org1.soapinterop.types.TempElt");
         Class innerClazz = clazz.getDeclaredClasses()[0];
         Method parseMethod = innerClazz.getMethod("parse",new Class[]{XMLStreamReader.class});

Modified: webservices/axis2/trunk/java/modules/codegen/test/org/apache/axis2/schema/populate/other/PopulateAnyTypeTest.java
URL: http://svn.apache.org/viewcvs/webservices/axis2/trunk/java/modules/codegen/test/org/apache/axis2/schema/populate/other/PopulateAnyTypeTest.java?rev=398793&r1=398792&r2=398793&view=diff
==============================================================================
--- webservices/axis2/trunk/java/modules/codegen/test/org/apache/axis2/schema/populate/other/PopulateAnyTypeTest.java (original)
+++ webservices/axis2/trunk/java/modules/codegen/test/org/apache/axis2/schema/populate/other/PopulateAnyTypeTest.java Mon May  1 20:38:53 2006
@@ -6,6 +6,8 @@
 import javax.xml.stream.XMLStreamReader;
 import java.io.ByteArrayInputStream;
 import java.lang.reflect.Method;
+
+import org.apache.axiom.om.util.StAXUtils;
 /*
  * Copyright 2004,2005 The Apache Software Foundation.
  *
@@ -37,7 +39,7 @@
 
     public void testPopulate() throws Exception{
 
-               XMLStreamReader reader = XMLInputFactory.newInstance().createXMLStreamReader(new ByteArrayInputStream(xmlString.getBytes()));
+               XMLStreamReader reader = StAXUtils.createXMLStreamReader(new ByteArrayInputStream(xmlString.getBytes()));
                Class clazz = Class.forName("org.soapinterop.xsd2.MyObject");
                Class innerClazz = clazz.getDeclaredClasses()[0];
                Method parseMethod = innerClazz.getMethod("parse",new Class[]{XMLStreamReader.class});

Modified: webservices/axis2/trunk/java/modules/codegen/test/org/apache/axis2/schema/populate/other/PopulateArrayInArrayTest.java
URL: http://svn.apache.org/viewcvs/webservices/axis2/trunk/java/modules/codegen/test/org/apache/axis2/schema/populate/other/PopulateArrayInArrayTest.java?rev=398793&r1=398792&r2=398793&view=diff
==============================================================================
--- webservices/axis2/trunk/java/modules/codegen/test/org/apache/axis2/schema/populate/other/PopulateArrayInArrayTest.java (original)
+++ webservices/axis2/trunk/java/modules/codegen/test/org/apache/axis2/schema/populate/other/PopulateArrayInArrayTest.java Mon May  1 20:38:53 2006
@@ -9,6 +9,8 @@
 import java.beans.PropertyDescriptor;
 import java.io.ByteArrayInputStream;
 import java.lang.reflect.Method;
+
+import org.apache.axiom.om.util.StAXUtils;
 /*
  * Copyright 2004,2005 The Apache Software Foundation.
  *
@@ -47,7 +49,7 @@
 
     public void testPopulate() throws Exception{
 
-            XMLStreamReader reader = XMLInputFactory.newInstance().createXMLStreamReader(new ByteArrayInputStream(xmlString.getBytes()));
+            XMLStreamReader reader = StAXUtils.createXMLStreamReader(new ByteArrayInputStream(xmlString.getBytes()));
             Class clazz = Class.forName("org.soapinterop.xsd.Myobject");
             Class innerClazz = clazz.getDeclaredClasses()[0];
             Method parseMethod = innerClazz.getMethod("parse",new Class[]{XMLStreamReader.class});

Modified: webservices/axis2/trunk/java/modules/codegen/test/org/apache/axis2/schema/populate/other/PopulateArrayTest.java
URL: http://svn.apache.org/viewcvs/webservices/axis2/trunk/java/modules/codegen/test/org/apache/axis2/schema/populate/other/PopulateArrayTest.java?rev=398793&r1=398792&r2=398793&view=diff
==============================================================================
--- webservices/axis2/trunk/java/modules/codegen/test/org/apache/axis2/schema/populate/other/PopulateArrayTest.java (original)
+++ webservices/axis2/trunk/java/modules/codegen/test/org/apache/axis2/schema/populate/other/PopulateArrayTest.java Mon May  1 20:38:53 2006
@@ -10,6 +10,8 @@
 import java.io.ByteArrayInputStream;
 import java.lang.reflect.Array;
 import java.lang.reflect.Method;
+
+import org.apache.axiom.om.util.StAXUtils;
 /*
  * Copyright 2004,2005 The Apache Software Foundation.
  *
@@ -37,7 +39,7 @@
 
     public void testPopulate() throws Exception{
 
-        XMLStreamReader reader = XMLInputFactory.newInstance().createXMLStreamReader(new ByteArrayInputStream(xmlString.getBytes()));
+        XMLStreamReader reader = StAXUtils.createXMLStreamReader(new ByteArrayInputStream(xmlString.getBytes()));
         Class clazz = Class.forName("org2.soapinterop.xsd.Myobject");
         Class innerClazz = clazz.getDeclaredClasses()[0];
         Method parseMethod = innerClazz.getMethod("parse",new Class[]{XMLStreamReader.class});

Modified: webservices/axis2/trunk/java/modules/codegen/test/org/apache/axis2/schema/populate/other/PopulateChoiceTest.java
URL: http://svn.apache.org/viewcvs/webservices/axis2/trunk/java/modules/codegen/test/org/apache/axis2/schema/populate/other/PopulateChoiceTest.java?rev=398793&r1=398792&r2=398793&view=diff
==============================================================================
--- webservices/axis2/trunk/java/modules/codegen/test/org/apache/axis2/schema/populate/other/PopulateChoiceTest.java (original)
+++ webservices/axis2/trunk/java/modules/codegen/test/org/apache/axis2/schema/populate/other/PopulateChoiceTest.java Mon May  1 20:38:53 2006
@@ -9,6 +9,8 @@
 import java.beans.BeanInfo;
 import java.beans.Introspector;
 import java.beans.PropertyDescriptor;
+
+import org.apache.axiom.om.util.StAXUtils;
 /*
  * Copyright 2004,2005 The Apache Software Foundation.
  *
@@ -32,7 +34,7 @@
 
     public void testPopulate() throws Exception{
 
-        XMLStreamReader reader = XMLInputFactory.newInstance().createXMLStreamReader(new ByteArrayInputStream(xmlString.getBytes()));
+        XMLStreamReader reader = StAXUtils.createXMLStreamReader(new ByteArrayInputStream(xmlString.getBytes()));
         Class clazz = Class.forName("org.soapinterop.types.MyElement");
         Class innerClazz = clazz.getDeclaredClasses()[0];
         Method parseMethod = innerClazz.getMethod("parse",new Class[]{XMLStreamReader.class});

Modified: webservices/axis2/trunk/java/modules/codegen/test/org/apache/axis2/schema/populate/other/PopulateComplexMinOccurs0Test.java
URL: http://svn.apache.org/viewcvs/webservices/axis2/trunk/java/modules/codegen/test/org/apache/axis2/schema/populate/other/PopulateComplexMinOccurs0Test.java?rev=398793&r1=398792&r2=398793&view=diff
==============================================================================
--- webservices/axis2/trunk/java/modules/codegen/test/org/apache/axis2/schema/populate/other/PopulateComplexMinOccurs0Test.java (original)
+++ webservices/axis2/trunk/java/modules/codegen/test/org/apache/axis2/schema/populate/other/PopulateComplexMinOccurs0Test.java Mon May  1 20:38:53 2006
@@ -12,6 +12,8 @@
 import java.lang.reflect.InvocationTargetException;
 import java.lang.reflect.Method;
 import java.io.ByteArrayInputStream;
+
+import org.apache.axiom.om.util.StAXUtils;
 /*
  * Copyright 2004,2005 The Apache Software Foundation.
  *
@@ -97,7 +99,7 @@
     private void populateAndAssert(String s,
                                    int expectedAddressCount,
                                    boolean personPresent) throws XMLStreamException, ClassNotFoundException, NoSuchMethodException, IllegalAccessException, InvocationTargetException, IntrospectionException {
-        XMLStreamReader reader = XMLInputFactory.newInstance().createXMLStreamReader(new ByteArrayInputStream(s.getBytes()));
+        XMLStreamReader reader = StAXUtils.createXMLStreamReader(new ByteArrayInputStream(s.getBytes()));
         Class clazz = Class.forName("org.test1.Root");
         Class innerClazz = clazz.getDeclaredClasses()[0];
         Method parseMethod = innerClazz.getMethod("parse", new Class[]{XMLStreamReader.class});

Modified: webservices/axis2/trunk/java/modules/codegen/test/org/apache/axis2/schema/populate/other/PopulateMinOccurs0Test.java
URL: http://svn.apache.org/viewcvs/webservices/axis2/trunk/java/modules/codegen/test/org/apache/axis2/schema/populate/other/PopulateMinOccurs0Test.java?rev=398793&r1=398792&r2=398793&view=diff
==============================================================================
--- webservices/axis2/trunk/java/modules/codegen/test/org/apache/axis2/schema/populate/other/PopulateMinOccurs0Test.java (original)
+++ webservices/axis2/trunk/java/modules/codegen/test/org/apache/axis2/schema/populate/other/PopulateMinOccurs0Test.java Mon May  1 20:38:53 2006
@@ -13,6 +13,8 @@
 import java.beans.Introspector;
 import java.beans.PropertyDescriptor;
 import java.beans.IntrospectionException;
+
+import org.apache.axiom.om.util.StAXUtils;
 /*
  * Copyright 2004,2005 The Apache Software Foundation.
  *
@@ -82,7 +84,7 @@
             IllegalAccessException, InvocationTargetException,
             IntrospectionException {
         XMLStreamReader reader =
-                XMLInputFactory.newInstance().createXMLStreamReader(new ByteArrayInputStream(s.getBytes()));
+                StAXUtils.createXMLStreamReader(new ByteArrayInputStream(s.getBytes()));
         Class clazz = Class.forName("org.test.Root");
         Class innerClazz = clazz.getDeclaredClasses()[0];
         Method parseMethod = innerClazz.getMethod("parse", new Class[]{XMLStreamReader.class});

Modified: webservices/axis2/trunk/java/modules/codegen/test/org/apache/axis2/schema/populate/other/PopulateMixedMinoccurs0Test.java
URL: http://svn.apache.org/viewcvs/webservices/axis2/trunk/java/modules/codegen/test/org/apache/axis2/schema/populate/other/PopulateMixedMinoccurs0Test.java?rev=398793&r1=398792&r2=398793&view=diff
==============================================================================
--- webservices/axis2/trunk/java/modules/codegen/test/org/apache/axis2/schema/populate/other/PopulateMixedMinoccurs0Test.java (original)
+++ webservices/axis2/trunk/java/modules/codegen/test/org/apache/axis2/schema/populate/other/PopulateMixedMinoccurs0Test.java Mon May  1 20:38:53 2006
@@ -12,6 +12,8 @@
 import java.beans.Introspector;
 import java.beans.PropertyDescriptor;
 import java.io.ByteArrayInputStream;
+
+import org.apache.axiom.om.util.StAXUtils;
 /*
  * Copyright 2004,2005 The Apache Software Foundation.
  *
@@ -74,7 +76,7 @@
 
 
     private void populateAndAssert(String s,int count) throws XMLStreamException, ClassNotFoundException, NoSuchMethodException, IllegalAccessException, InvocationTargetException, IntrospectionException {
-        XMLStreamReader reader = XMLInputFactory.newInstance().createXMLStreamReader(new ByteArrayInputStream(s.getBytes()));
+        XMLStreamReader reader = StAXUtils.createXMLStreamReader(new ByteArrayInputStream(s.getBytes()));
         Class clazz = Class.forName("org.recursion1.StringListResponseElement");
         Class innerClazz = clazz.getDeclaredClasses()[0];
         Method parseMethod = innerClazz.getMethod("parse", new Class[]{XMLStreamReader.class});

Modified: webservices/axis2/trunk/java/modules/codegen/test/org/apache/axis2/schema/populate/other/PopulateRecursiveTest.java
URL: http://svn.apache.org/viewcvs/webservices/axis2/trunk/java/modules/codegen/test/org/apache/axis2/schema/populate/other/PopulateRecursiveTest.java?rev=398793&r1=398792&r2=398793&view=diff
==============================================================================
--- webservices/axis2/trunk/java/modules/codegen/test/org/apache/axis2/schema/populate/other/PopulateRecursiveTest.java (original)
+++ webservices/axis2/trunk/java/modules/codegen/test/org/apache/axis2/schema/populate/other/PopulateRecursiveTest.java Mon May  1 20:38:53 2006
@@ -12,6 +12,8 @@
 import java.beans.Introspector;
 import java.beans.BeanInfo;
 import java.io.ByteArrayInputStream;
+
+import org.apache.axiom.om.util.StAXUtils;
 /*
  * Copyright 2004,2005 The Apache Software Foundation.
  *
@@ -45,7 +47,7 @@
 
     private void populateAndAssert(String s
     ) throws XMLStreamException, ClassNotFoundException, NoSuchMethodException, IllegalAccessException, InvocationTargetException, IntrospectionException {
-        XMLStreamReader reader = XMLInputFactory.newInstance().createXMLStreamReader(new ByteArrayInputStream(s.getBytes()));
+        XMLStreamReader reader = StAXUtils.createXMLStreamReader(new ByteArrayInputStream(s.getBytes()));
         Class clazz = Class.forName("org.recursion.E");
         Class innerClazz = clazz.getDeclaredClasses()[0];
         Method parseMethod = innerClazz.getMethod("parse", new Class[]{XMLStreamReader.class});

Modified: webservices/axis2/trunk/java/modules/codegen/test/org/apache/axis2/schema/populate/simple/AbstractSimplePopulater.java
URL: http://svn.apache.org/viewcvs/webservices/axis2/trunk/java/modules/codegen/test/org/apache/axis2/schema/populate/simple/AbstractSimplePopulater.java?rev=398793&r1=398792&r2=398793&view=diff
==============================================================================
--- webservices/axis2/trunk/java/modules/codegen/test/org/apache/axis2/schema/populate/simple/AbstractSimplePopulater.java (original)
+++ webservices/axis2/trunk/java/modules/codegen/test/org/apache/axis2/schema/populate/simple/AbstractSimplePopulater.java Mon May  1 20:38:53 2006
@@ -9,6 +9,8 @@
 import java.beans.PropertyDescriptor;
 import java.io.ByteArrayInputStream;
 import java.lang.reflect.Method;
+
+import org.apache.axiom.om.util.StAXUtils;
 /*
  * Copyright 2004,2005 The Apache Software Foundation.
  *
@@ -34,7 +36,7 @@
 
     // Simple reusable method to make object instances via reflection
     protected Object process(String testString,String className) throws Exception{
-        XMLStreamReader reader = XMLInputFactory.newInstance().createXMLStreamReader(new ByteArrayInputStream(testString.getBytes()));
+        XMLStreamReader reader = StAXUtils.createXMLStreamReader(new ByteArrayInputStream(testString.getBytes()));
         Class clazz = Class.forName(className);
         Class[] declaredClasse = clazz.getDeclaredClasses();
         //ideally this should be 1

Modified: webservices/axis2/trunk/java/modules/core/src/org/apache/axis2/deployment/DescriptionBuilder.java
URL: http://svn.apache.org/viewcvs/webservices/axis2/trunk/java/modules/core/src/org/apache/axis2/deployment/DescriptionBuilder.java?rev=398793&r1=398792&r2=398793&view=diff
==============================================================================
--- webservices/axis2/trunk/java/modules/core/src/org/apache/axis2/deployment/DescriptionBuilder.java (original)
+++ webservices/axis2/trunk/java/modules/core/src/org/apache/axis2/deployment/DescriptionBuilder.java Mon May  1 20:38:53 2006
@@ -21,6 +21,7 @@
 import org.apache.axiom.om.OMAttribute;
 import org.apache.axiom.om.OMElement;
 import org.apache.axiom.om.OMFactory;
+import org.apache.axiom.om.util.StAXUtils;
 import org.apache.axiom.om.impl.builder.StAXOMBuilder;
 import org.apache.axis2.AxisFault;
 import org.apache.axis2.wsdl.WSDLConstants;
@@ -78,7 +79,7 @@
      */
     public OMElement buildOM() throws XMLStreamException {
         XMLStreamReader xmlReader =
-                XMLInputFactory.newInstance().createXMLStreamReader(descriptionStream);
+                StAXUtils.createXMLStreamReader(descriptionStream);
         OMFactory fac = OMAbstractFactory.getOMFactory();
         StAXOMBuilder staxOMBuilder = new StAXOMBuilder(fac, xmlReader);
         OMElement element = staxOMBuilder.getDocumentElement();

Modified: webservices/axis2/trunk/java/modules/core/src/org/apache/axis2/description/AxisService2OM.java
URL: http://svn.apache.org/viewcvs/webservices/axis2/trunk/java/modules/core/src/org/apache/axis2/description/AxisService2OM.java?rev=398793&r1=398792&r2=398793&view=diff
==============================================================================
--- webservices/axis2/trunk/java/modules/core/src/org/apache/axis2/description/AxisService2OM.java (original)
+++ webservices/axis2/trunk/java/modules/core/src/org/apache/axis2/description/AxisService2OM.java Mon May  1 20:38:53 2006
@@ -17,6 +17,7 @@
 import org.apache.axiom.om.OMElement;
 import org.apache.axiom.om.OMFactory;
 import org.apache.axiom.om.OMNamespace;
+import org.apache.axiom.om.util.StAXUtils;
 import org.apache.axiom.om.impl.builder.StAXOMBuilder;
 import org.apache.axiom.om.impl.llom.factory.OMXMLBuilderFactory;
 import org.apache.axis2.wsdl.SOAPHeaderMessage;
@@ -145,8 +146,7 @@
 
             schema.write(writer);
             if (!"".equals(writer.toString())) {
-                XMLInputFactory xmlInputFactory = XMLInputFactory.newInstance();
-                XMLStreamReader xmlReader = xmlInputFactory
+                XMLStreamReader xmlReader = StAXUtils
                         .createXMLStreamReader(new ByteArrayInputStream(writer
                                 .toString().getBytes()));
 
@@ -786,7 +786,7 @@
                         .toByteArray());
                 element.addChild(OMXMLBuilderFactory.createStAXOMBuilder(
                         factory,
-                        XMLInputFactory.newInstance().createXMLStreamReader(
+                        StAXUtils.createXMLStreamReader(
                                 bais)).getDocumentElement());
 
             } else if (policyElement instanceof PolicyReference) {
@@ -806,7 +806,7 @@
                         .toByteArray());
                 getDefinitionElement().addChild(OMXMLBuilderFactory.createStAXOMBuilder(
                         factory,
-                        XMLInputFactory.newInstance().createXMLStreamReader(
+                        StAXUtils.createXMLStreamReader(
                                 bais)).getDocumentElement());
                 
                 // TODO refactor this ..

Modified: webservices/axis2/trunk/java/modules/core/src/org/apache/axis2/transport/TransportUtils.java
URL: http://svn.apache.org/viewcvs/webservices/axis2/trunk/java/modules/core/src/org/apache/axis2/transport/TransportUtils.java?rev=398793&r1=398792&r2=398793&view=diff
==============================================================================
--- webservices/axis2/trunk/java/modules/core/src/org/apache/axis2/transport/TransportUtils.java (original)
+++ webservices/axis2/trunk/java/modules/core/src/org/apache/axis2/transport/TransportUtils.java Mon May  1 20:38:53 2006
@@ -19,6 +19,7 @@
 
 import org.apache.axiom.attachments.Attachments;
 import org.apache.axiom.om.OMException;
+import org.apache.axiom.om.util.StAXUtils;
 import org.apache.axiom.om.impl.MTOMConstants;
 import org.apache.axiom.om.impl.builder.StAXBuilder;
 import org.apache.axiom.om.impl.builder.StAXOMBuilder;
@@ -99,7 +100,7 @@
                 envelope = (SOAPEnvelope) builder.getDocumentElement();
             } else if (msgContext.isDoingREST()) {
                 XMLStreamReader xmlreader =
-                        XMLInputFactory.newInstance().createXMLStreamReader(inStream, charSetEnc);
+                        StAXUtils.createXMLStreamReader(inStream, charSetEnc);
                 SOAPFactory soapFactory = new SOAP11Factory();
 
                 builder = new StAXOMBuilder(xmlreader);
@@ -114,7 +115,7 @@
                 envelope = (SOAPEnvelope) builder.getDocumentElement();
             } else {
                 XMLStreamReader xmlreader =
-                        XMLInputFactory.newInstance().createXMLStreamReader(inStream, charSetEnc);
+                        StAXUtils.createXMLStreamReader(inStream, charSetEnc);
 
                 builder = new StAXSOAPModelBuilder(xmlreader, soapNamespaceURI);
                 envelope = (SOAPEnvelope) builder.getDocumentElement();
@@ -210,7 +211,7 @@
         }
 
         try {
-            streamReader = XMLInputFactory.newInstance().createXMLStreamReader(
+            streamReader = StAXUtils.createXMLStreamReader(
                     getReader(attachments.getSOAPPartInputStream(), charSetEncoding));
         } catch (IOException e) {
             throw new XMLStreamException(e);

Modified: webservices/axis2/trunk/java/modules/core/src/org/apache/axis2/transport/http/HTTPTransportUtils.java
URL: http://svn.apache.org/viewcvs/webservices/axis2/trunk/java/modules/core/src/org/apache/axis2/transport/http/HTTPTransportUtils.java?rev=398793&r1=398792&r2=398793&view=diff
==============================================================================
--- webservices/axis2/trunk/java/modules/core/src/org/apache/axis2/transport/http/HTTPTransportUtils.java (original)
+++ webservices/axis2/trunk/java/modules/core/src/org/apache/axis2/transport/http/HTTPTransportUtils.java Mon May  1 20:38:53 2006
@@ -20,6 +20,7 @@
 import org.apache.axiom.om.OMElement;
 import org.apache.axiom.om.OMException;
 import org.apache.axiom.om.OMNamespace;
+import org.apache.axiom.om.util.StAXUtils;
 import org.apache.axiom.om.impl.builder.StAXBuilder;
 import org.apache.axiom.om.impl.builder.StAXOMBuilder;
 import org.apache.axiom.soap.*;
@@ -184,7 +185,7 @@
 
                     // If charset is not specified
                     if (TransportUtils.getCharSetEncoding(contentType) == null) {
-                        xmlreader = XMLInputFactory.newInstance().createXMLStreamReader(in,
+                        xmlreader = StAXUtils.createXMLStreamReader(in,
                                 MessageContext.DEFAULT_CHAR_SET_ENCODING);
 
                         // Set the encoding scheme in the message context
@@ -195,7 +196,7 @@
                         // get the type of char encoding
                         String charSetEnc = TransportUtils.getCharSetEncoding(contentType);
 
-                        xmlreader = XMLInputFactory.newInstance().createXMLStreamReader(in,
+                        xmlreader = StAXUtils.createXMLStreamReader(in,
                                 charSetEnc);
 
                         // Setting the value in msgCtx
@@ -243,7 +244,7 @@
             }
 
             if (builder == null) {
-                XMLStreamReader xmlreader = XMLInputFactory.newInstance().createXMLStreamReader(in,
+                XMLStreamReader xmlreader = StAXUtils.createXMLStreamReader(in,
                         MessageContext.DEFAULT_CHAR_SET_ENCODING);
 
                 // Set the encoding scheme in the message context

Modified: webservices/axis2/trunk/java/modules/core/src/org/apache/axis2/transport/http/util/RESTUtil.java
URL: http://svn.apache.org/viewcvs/webservices/axis2/trunk/java/modules/core/src/org/apache/axis2/transport/http/util/RESTUtil.java?rev=398793&r1=398792&r2=398793&view=diff
==============================================================================
--- webservices/axis2/trunk/java/modules/core/src/org/apache/axis2/transport/http/util/RESTUtil.java (original)
+++ webservices/axis2/trunk/java/modules/core/src/org/apache/axis2/transport/http/util/RESTUtil.java Mon May  1 20:38:53 2006
@@ -16,6 +16,7 @@
 package org.apache.axis2.transport.http.util;
 
 import org.apache.axiom.om.OMAbstractFactory;
+import org.apache.axiom.om.util.StAXUtils;
 import org.apache.axiom.om.impl.builder.StAXOMBuilder;
 import org.apache.axiom.soap.SOAPBody;
 import org.apache.axiom.soap.SOAPEnvelope;
@@ -193,7 +194,7 @@
                     // get the type of char encoding
                     String charSetEnc = TransportUtils.getCharSetEncoding(contentType);
 
-                    xmlreader = XMLInputFactory.newInstance().createXMLStreamReader(inputStream,
+                    xmlreader = StAXUtils.createXMLStreamReader(inputStream,
                             charSetEnc);
 
                     // Setting the value in msgCtx

Modified: webservices/axis2/trunk/java/modules/core/src/org/apache/axis2/transport/jms/SimpleJMSWorker.java
URL: http://svn.apache.org/viewcvs/webservices/axis2/trunk/java/modules/core/src/org/apache/axis2/transport/jms/SimpleJMSWorker.java?rev=398793&r1=398792&r2=398793&view=diff
==============================================================================
--- webservices/axis2/trunk/java/modules/core/src/org/apache/axis2/transport/jms/SimpleJMSWorker.java (original)
+++ webservices/axis2/trunk/java/modules/core/src/org/apache/axis2/transport/jms/SimpleJMSWorker.java Mon May  1 20:38:53 2006
@@ -18,6 +18,7 @@
 package org.apache.axis2.transport.jms;
 
 import org.apache.axiom.om.OMException;
+import org.apache.axiom.om.util.StAXUtils;
 import org.apache.axiom.om.impl.builder.StAXBuilder;
 import org.apache.axiom.soap.SOAP11Constants;
 import org.apache.axiom.soap.SOAP12Constants;
@@ -91,7 +92,7 @@
 
                     // If charset is not specified
                     if (TransportUtils.getCharSetEncoding(contentType) == null) {
-                        xmlreader = XMLInputFactory.newInstance().createXMLStreamReader(in,
+                        xmlreader = StAXUtils.createXMLStreamReader(in,
                                 MessageContext.DEFAULT_CHAR_SET_ENCODING);
 
                         // Set the encoding scheme in the message context
@@ -102,7 +103,7 @@
                         // get the type of char encoding
                         String charSetEnc = TransportUtils.getCharSetEncoding(contentType);
 
-                        xmlreader = XMLInputFactory.newInstance().createXMLStreamReader(in,
+                        xmlreader = StAXUtils.createXMLStreamReader(in,
                                 charSetEnc);
 
                         // Setting the value in msgCtx

Modified: webservices/axis2/trunk/java/modules/core/src/org/apache/axis2/transport/local/LocalTransportReceiver.java
URL: http://svn.apache.org/viewcvs/webservices/axis2/trunk/java/modules/core/src/org/apache/axis2/transport/local/LocalTransportReceiver.java?rev=398793&r1=398792&r2=398793&view=diff
==============================================================================
--- webservices/axis2/trunk/java/modules/core/src/org/apache/axis2/transport/local/LocalTransportReceiver.java (original)
+++ webservices/axis2/trunk/java/modules/core/src/org/apache/axis2/transport/local/LocalTransportReceiver.java Mon May  1 20:38:53 2006
@@ -18,6 +18,7 @@
 package org.apache.axis2.transport.local;
 
 import org.apache.axiom.om.impl.builder.StAXBuilder;
+import org.apache.axiom.om.util.StAXUtils;
 import org.apache.axiom.soap.SOAPEnvelope;
 import org.apache.axiom.soap.impl.builder.StAXSOAPModelBuilder;
 import org.apache.axis2.AxisFault;
@@ -70,7 +71,7 @@
             msgCtx.setServerSide(true);
             msgCtx.setProperty(MessageContext.TRANSPORT_OUT, sender.getResponse());
 
-            XMLStreamReader reader = XMLInputFactory.newInstance().createXMLStreamReader(
+            XMLStreamReader reader = StAXUtils.createXMLStreamReader(
                     new BufferedReader(new InputStreamReader(in)));
             StAXBuilder builder = new StAXSOAPModelBuilder(reader, null);
             SOAPEnvelope envelope = (SOAPEnvelope) builder.getDocumentElement();

Modified: webservices/axis2/trunk/java/modules/core/src/org/apache/axis2/transport/mail/MailWorker.java
URL: http://svn.apache.org/viewcvs/webservices/axis2/trunk/java/modules/core/src/org/apache/axis2/transport/mail/MailWorker.java?rev=398793&r1=398792&r2=398793&view=diff
==============================================================================
--- webservices/axis2/trunk/java/modules/core/src/org/apache/axis2/transport/mail/MailWorker.java (original)
+++ webservices/axis2/trunk/java/modules/core/src/org/apache/axis2/transport/mail/MailWorker.java Mon May  1 20:38:53 2006
@@ -18,6 +18,7 @@
 package org.apache.axis2.transport.mail;
 
 import org.apache.axiom.om.impl.builder.StAXBuilder;
+import org.apache.axiom.om.util.StAXUtils;
 import org.apache.axiom.soap.SOAP11Constants;
 import org.apache.axiom.soap.SOAP12Constants;
 import org.apache.axiom.soap.SOAPEnvelope;
@@ -117,7 +118,7 @@
                 ByteArrayInputStream bais =
                         new ByteArrayInputStream(message.getBytes());
                 XMLStreamReader reader =
-                        XMLInputFactory.newInstance().createXMLStreamReader(bais);
+                        StAXUtils.createXMLStreamReader(bais);
                 String soapNamespaceURI = "";
                 if (mimeMessage.getContentType().indexOf(SOAP12Constants.SOAP_12_CONTENT_TYPE)
                         > -1) {

Modified: webservices/axis2/trunk/java/modules/core/src/org/apache/axis2/transport/mail/server/MailSorter.java
URL: http://svn.apache.org/viewcvs/webservices/axis2/trunk/java/modules/core/src/org/apache/axis2/transport/mail/server/MailSorter.java?rev=398793&r1=398792&r2=398793&view=diff
==============================================================================
--- webservices/axis2/trunk/java/modules/core/src/org/apache/axis2/transport/mail/server/MailSorter.java (original)
+++ webservices/axis2/trunk/java/modules/core/src/org/apache/axis2/transport/mail/server/MailSorter.java Mon May  1 20:38:53 2006
@@ -1,6 +1,7 @@
 package org.apache.axis2.transport.mail.server;
 
 import org.apache.axiom.om.impl.builder.StAXBuilder;
+import org.apache.axiom.om.util.StAXUtils;
 import org.apache.axiom.soap.SOAP11Constants;
 import org.apache.axiom.soap.SOAP12Constants;
 import org.apache.axiom.soap.SOAPEnvelope;
@@ -98,7 +99,7 @@
 
             ByteArrayInputStream bais = new ByteArrayInputStream(message.getBytes());
             XMLStreamReader reader =
-                    XMLInputFactory.newInstance().createXMLStreamReader(bais);
+                    StAXUtils.createXMLStreamReader(bais);
             String soapNamespaceURI = "";
 
             if (mimeMessage.getContentType().indexOf(SOAP12Constants.SOAP_12_CONTENT_TYPE) > -1) {

Modified: webservices/axis2/trunk/java/modules/core/src/org/apache/axis2/transport/tcp/TCPWorker.java
URL: http://svn.apache.org/viewcvs/webservices/axis2/trunk/java/modules/core/src/org/apache/axis2/transport/tcp/TCPWorker.java?rev=398793&r1=398792&r2=398793&view=diff
==============================================================================
--- webservices/axis2/trunk/java/modules/core/src/org/apache/axis2/transport/tcp/TCPWorker.java (original)
+++ webservices/axis2/trunk/java/modules/core/src/org/apache/axis2/transport/tcp/TCPWorker.java Mon May  1 20:38:53 2006
@@ -18,6 +18,7 @@
 package org.apache.axis2.transport.tcp;
 
 import org.apache.axiom.om.impl.builder.StAXBuilder;
+import org.apache.axiom.om.util.StAXUtils;
 import org.apache.axiom.soap.SOAPEnvelope;
 import org.apache.axiom.soap.impl.builder.StAXSOAPModelBuilder;
 import org.apache.axis2.AxisFault;
@@ -81,7 +82,7 @@
 
                 // create the SOAP Envelope
                 Reader in = new InputStreamReader(socket.getInputStream());
-                XMLStreamReader xmlreader = XMLInputFactory.newInstance().createXMLStreamReader(in);
+                XMLStreamReader xmlreader = StAXUtils.createXMLStreamReader(in);
                 StAXBuilder builder = new StAXSOAPModelBuilder(xmlreader, null);
                 SOAPEnvelope envelope = (SOAPEnvelope) builder.getDocumentElement();
 

Modified: webservices/axis2/trunk/java/modules/core/test/org/apache/axis2/transport/tcp/TCPTransportTest.java
URL: http://svn.apache.org/viewcvs/webservices/axis2/trunk/java/modules/core/test/org/apache/axis2/transport/tcp/TCPTransportTest.java?rev=398793&r1=398792&r2=398793&view=diff
==============================================================================
--- webservices/axis2/trunk/java/modules/core/test/org/apache/axis2/transport/tcp/TCPTransportTest.java (original)
+++ webservices/axis2/trunk/java/modules/core/test/org/apache/axis2/transport/tcp/TCPTransportTest.java Mon May  1 20:38:53 2006
@@ -18,6 +18,7 @@
 
 import junit.framework.TestCase;
 import org.apache.axiom.om.impl.builder.StAXBuilder;
+import org.apache.axiom.om.util.StAXUtils;
 import org.apache.axiom.soap.SOAPEnvelope;
 import org.apache.axiom.soap.impl.builder.StAXSOAPModelBuilder;
 import org.apache.axis2.AxisFault;
@@ -37,7 +38,7 @@
     public SOAPEnvelope createSOAPEnvelope(InputStream in) throws AxisFault {
         try {
             XMLStreamReader xmlreader =
-                    XMLInputFactory.newInstance().createXMLStreamReader(in);
+                    StAXUtils.createXMLStreamReader(in);
             StAXBuilder builder = new StAXSOAPModelBuilder(xmlreader, null);
             return (SOAPEnvelope) builder.getDocumentElement();
         } catch (Exception e) {

Modified: webservices/axis2/trunk/java/modules/integration/itest/org/apache/axis2/rest/GetTest.java
URL: http://svn.apache.org/viewcvs/webservices/axis2/trunk/java/modules/integration/itest/org/apache/axis2/rest/GetTest.java?rev=398793&r1=398792&r2=398793&view=diff
==============================================================================
--- webservices/axis2/trunk/java/modules/integration/itest/org/apache/axis2/rest/GetTest.java (original)
+++ webservices/axis2/trunk/java/modules/integration/itest/org/apache/axis2/rest/GetTest.java Mon May  1 20:38:53 2006
@@ -29,6 +29,7 @@
 import org.apache.axis2.client.Options;
 import org.apache.axis2.client.ServiceClient;
 import org.apache.axiom.om.OMElement;
+import org.apache.axiom.om.util.StAXUtils;
 import org.apache.axiom.om.impl.builder.StAXOMBuilder;
 
 public class GetTest extends TestCase {
@@ -46,8 +47,7 @@
 
         XMLStreamReader reader = null;
         try {
-            XMLInputFactory xif = XMLInputFactory.newInstance();
-            reader = xif.createXMLStreamReader(bais);
+            reader = StAXUtils.createXMLStreamReader(bais);
         } catch (XMLStreamException e) {
             e.printStackTrace();
         }

Modified: webservices/axis2/trunk/java/modules/integration/itest/org/apache/axis2/rest/PostTest.java
URL: http://svn.apache.org/viewcvs/webservices/axis2/trunk/java/modules/integration/itest/org/apache/axis2/rest/PostTest.java?rev=398793&r1=398792&r2=398793&view=diff
==============================================================================
--- webservices/axis2/trunk/java/modules/integration/itest/org/apache/axis2/rest/PostTest.java (original)
+++ webservices/axis2/trunk/java/modules/integration/itest/org/apache/axis2/rest/PostTest.java Mon May  1 20:38:53 2006
@@ -34,6 +34,7 @@
 import org.apache.axis2.client.ServiceClient;
 import org.apache.axis2.transport.http.HTTPConstants;
 import org.apache.axiom.om.OMElement;
+import org.apache.axiom.om.util.StAXUtils;
 import org.apache.axiom.om.impl.builder.StAXOMBuilder;
 
 /**
@@ -60,8 +61,7 @@
 
             XMLStreamReader reader = null;
             try {
-                XMLInputFactory xif = XMLInputFactory.newInstance();
-                reader = xif.createXMLStreamReader(bais);
+                reader = StAXUtils.createXMLStreamReader(bais);
             } catch (XMLStreamException e) {
                 e.printStackTrace();
             }
@@ -80,7 +80,7 @@
             OMElement result = sender.sendReceive(websearch);
 
             StringWriter writer = new StringWriter();
-            result.serialize(XMLOutputFactory.newInstance()
+            result.serialize(StAXUtils
                     .createXMLStreamWriter(writer));
             writer.flush();
 

Modified: webservices/axis2/trunk/java/modules/integration/itest/org/apache/axis2/rest/RESTBasedEchoRawXMLTest.java
URL: http://svn.apache.org/viewcvs/webservices/axis2/trunk/java/modules/integration/itest/org/apache/axis2/rest/RESTBasedEchoRawXMLTest.java?rev=398793&r1=398792&r2=398793&view=diff
==============================================================================
--- webservices/axis2/trunk/java/modules/integration/itest/org/apache/axis2/rest/RESTBasedEchoRawXMLTest.java (original)
+++ webservices/axis2/trunk/java/modules/integration/itest/org/apache/axis2/rest/RESTBasedEchoRawXMLTest.java Mon May  1 20:38:53 2006
@@ -46,25 +46,6 @@
         super(testName);
     }
 
-//    public static Test suite() {
-//        return getTestSetup(new TestSuite(RESTBasedEchoRawXMLTest.class));
-//    }
-//
-//    protected void setUp() throws Exception {
-//        Parameter parameter = new Parameter(
-//                Constants.Configuration.ENABLE_REST, "true");
-//        UtilServer.getConfigurationContext()
-//                .getAxisConfiguration().addParameter(parameter);
-//        AxisService service = Utils.createSimpleService(serviceName,
-//                Echo.class.getName(),
-//                operationName);
-//        UtilServer.deployService(service);
-//    }
-//
-//    protected void tearDown() throws Exception {
-//        UtilServer.unDeployService(serviceName);
-//    }
-
     private OMElement createEnvelope() {
         OMFactory fac = OMAbstractFactory.getOMFactory();
         OMNamespace omNs = fac.createOMNamespace("http://localhost/my", "my");
@@ -77,24 +58,4 @@
         return method;
     }
 
-
-//    public void testEchoXMLSync() throws Exception {
-//        OMElement payload = createEnvelope();
-//        Options options = new Options();
-//        options.setTo(targetEPR);
-//        options.setTransportInProtocol(Constants.TRANSPORT_HTTP);
-//        options.setProperty(Constants.Configuration.ENABLE_REST, Constants.VALUE_TRUE);
-//
-//        ConfigurationContext configContext =
-//                ConfigurationContextFactory.createConfigurationContextFromFileSystem("target/test-resources/integrationRepo",null);
-//        ServiceClient sender = new ServiceClient(configContext, null);
-//        sender.setOptions(options);
-//        options.setTo(targetEPR);
-//        OMElement result = sender.sendReceive(payload);
-//
-//        result.serialize(XMLOutputFactory.newInstance().createXMLStreamWriter(
-//                System.out));
-//
-//
-//    }
 }

Modified: webservices/axis2/trunk/java/modules/integration/itest/org/apache/axis2/rest/RESTGetTest.java
URL: http://svn.apache.org/viewcvs/webservices/axis2/trunk/java/modules/integration/itest/org/apache/axis2/rest/RESTGetTest.java?rev=398793&r1=398792&r2=398793&view=diff
==============================================================================
--- webservices/axis2/trunk/java/modules/integration/itest/org/apache/axis2/rest/RESTGetTest.java (original)
+++ webservices/axis2/trunk/java/modules/integration/itest/org/apache/axis2/rest/RESTGetTest.java Mon May  1 20:38:53 2006
@@ -13,6 +13,7 @@
 import org.apache.axis2.client.Options;
 import org.apache.axis2.client.ServiceClient;
 import org.apache.axiom.om.OMElement;
+import org.apache.axiom.om.util.StAXUtils;
 import org.apache.axiom.om.impl.builder.StAXOMBuilder;
 
 //This Sample test Client is written for Yahoo Web Search
@@ -34,8 +35,7 @@
 
         XMLStreamReader reader = null;
         try {
-            XMLInputFactory xif = XMLInputFactory.newInstance();
-            reader = xif.createXMLStreamReader(bais);
+            reader = StAXUtils.createXMLStreamReader(bais);
         } catch (XMLStreamException e) {
             e.printStackTrace();
         }

Modified: webservices/axis2/trunk/java/modules/integration/itest/test/interop/sun/complex/SunGroupHMain.java
URL: http://svn.apache.org/viewcvs/webservices/axis2/trunk/java/modules/integration/itest/test/interop/sun/complex/SunGroupHMain.java?rev=398793&r1=398792&r2=398793&view=diff
==============================================================================
--- webservices/axis2/trunk/java/modules/integration/itest/test/interop/sun/complex/SunGroupHMain.java (original)
+++ webservices/axis2/trunk/java/modules/integration/itest/test/interop/sun/complex/SunGroupHMain.java Mon May  1 20:38:53 2006
@@ -25,6 +25,7 @@
 
 import org.apache.axiom.om.OMElement;
 import org.apache.axiom.om.OMXMLParserWrapper;
+import org.apache.axiom.om.util.StAXUtils;
 import org.apache.axiom.om.impl.exception.XMLComparisonException;
 import org.apache.axiom.om.impl.llom.util.XMLComparator;
 import org.apache.axiom.soap.SOAPEnvelope;
@@ -54,7 +55,7 @@
         if(retEle!=null){
              InputStream stream = Thread.currentThread()
                      .getContextClassLoader().getResourceAsStream(filepath);
-            javax.xml.stream.XMLStreamReader parser = XMLInputFactory.newInstance().createXMLStreamReader(stream);
+            javax.xml.stream.XMLStreamReader parser = StAXUtils.createXMLStreamReader(stream);
             OMXMLParserWrapper builder = new StAXSOAPModelBuilder(parser, null);
             SOAPEnvelope resEnv = (SOAPEnvelope) builder.getDocumentElement();
             OMElement resElementtobe = resEnv.getBody().getFirstElement();

Modified: webservices/axis2/trunk/java/modules/integration/itest/test/interop/sun/simple/SunGroupHMain.java
URL: http://svn.apache.org/viewcvs/webservices/axis2/trunk/java/modules/integration/itest/test/interop/sun/simple/SunGroupHMain.java?rev=398793&r1=398792&r2=398793&view=diff
==============================================================================
--- webservices/axis2/trunk/java/modules/integration/itest/test/interop/sun/simple/SunGroupHMain.java (original)
+++ webservices/axis2/trunk/java/modules/integration/itest/test/interop/sun/simple/SunGroupHMain.java Mon May  1 20:38:53 2006
@@ -10,6 +10,7 @@
 
 import org.apache.axiom.om.OMElement;
 import org.apache.axiom.om.OMXMLParserWrapper;
+import org.apache.axiom.om.util.StAXUtils;
 import org.apache.axiom.om.impl.exception.XMLComparisonException;
 import org.apache.axiom.soap.SOAPEnvelope;
 import org.apache.axiom.soap.impl.builder.StAXSOAPModelBuilder;
@@ -43,7 +44,7 @@
         if(retEle!=null){
              InputStream stream = Thread.currentThread()
                      .getContextClassLoader().getResourceAsStream(filepath);
-            javax.xml.stream.XMLStreamReader parser = XMLInputFactory.newInstance().createXMLStreamReader(stream);
+            javax.xml.stream.XMLStreamReader parser = StAXUtils.createXMLStreamReader(stream);
             OMXMLParserWrapper builder = new StAXSOAPModelBuilder(parser, null);
             SOAPEnvelope resEnv = (SOAPEnvelope) builder.getDocumentElement();
             OMElement resElementtobe = resEnv.getBody().getFirstElement();

Modified: webservices/axis2/trunk/java/modules/integration/src/test/interop/whitemesa/WhiteMesaIneterop.java
URL: http://svn.apache.org/viewcvs/webservices/axis2/trunk/java/modules/integration/src/test/interop/whitemesa/WhiteMesaIneterop.java?rev=398793&r1=398792&r2=398793&view=diff
==============================================================================
--- webservices/axis2/trunk/java/modules/integration/src/test/interop/whitemesa/WhiteMesaIneterop.java (original)
+++ webservices/axis2/trunk/java/modules/integration/src/test/interop/whitemesa/WhiteMesaIneterop.java Mon May  1 20:38:53 2006
@@ -27,6 +27,7 @@
 import org.apache.axiom.om.OMElement;
 import org.apache.axiom.om.OMText;
 import org.apache.axiom.om.OMXMLParserWrapper;
+import org.apache.axiom.om.util.StAXUtils;
 import org.apache.axiom.om.xpath.AXIOMXPath;
 import org.apache.axiom.soap.SOAPBody;
 import org.apache.axiom.soap.SOAPEnvelope;
@@ -50,7 +51,7 @@
                             .getContextClassLoader().getResourceAsStream(
                             filePath);
 
-                    XMLStreamReader parser = XMLInputFactory.newInstance()
+                    XMLStreamReader parser = StAXUtils
                             .createXMLStreamReader(stream);
                     OMXMLParserWrapper builder = new StAXSOAPModelBuilder(
                             parser, null);

Modified: webservices/axis2/trunk/java/modules/integration/src/test/soap12testing/client/MessageComparator.java
URL: http://svn.apache.org/viewcvs/webservices/axis2/trunk/java/modules/integration/src/test/soap12testing/client/MessageComparator.java?rev=398793&r1=398792&r2=398793&view=diff
==============================================================================
--- webservices/axis2/trunk/java/modules/integration/src/test/soap12testing/client/MessageComparator.java (original)
+++ webservices/axis2/trunk/java/modules/integration/src/test/soap12testing/client/MessageComparator.java Mon May  1 20:38:53 2006
@@ -17,6 +17,7 @@
 package test.soap12testing.client;
 
 import org.apache.axiom.om.OMXMLParserWrapper;
+import org.apache.axiom.om.util.StAXUtils;
 import org.apache.axiom.om.impl.exception.XMLComparisonException;
 import org.apache.axiom.soap.SOAPEnvelope;
 import org.apache.axiom.soap.impl.builder.StAXSOAPModelBuilder;
@@ -48,11 +49,11 @@
             //This step is needed to skip the headers :)
             receiver.parseTheHeaders(replyMessage, false);
 
-            XMLStreamReader requiredMessageParser = XMLInputFactory.newInstance().createXMLStreamReader(new FileReader(file));
+            XMLStreamReader requiredMessageParser = StAXUtils.createXMLStreamReader(new FileReader(file));
             OMXMLParserWrapper requiredMessageBuilder = new StAXSOAPModelBuilder(requiredMessageParser,null);
             requiredMessageEnvelope = (SOAPEnvelope) requiredMessageBuilder.getDocumentElement();
 
-            XMLStreamReader replyMessageParser = XMLInputFactory.newInstance().createXMLStreamReader(replyMessage);
+            XMLStreamReader replyMessageParser = StAXUtils.createXMLStreamReader(replyMessage);
             OMXMLParserWrapper replyMessageBuilder = new StAXSOAPModelBuilder(replyMessageParser,null);
             replyMessageEnvelope = (SOAPEnvelope) replyMessageBuilder.getDocumentElement();
 

Modified: webservices/axis2/trunk/java/modules/integration/src/test/soap12testing/client/SOAPCreater.java
URL: http://svn.apache.org/viewcvs/webservices/axis2/trunk/java/modules/integration/src/test/soap12testing/client/SOAPCreater.java?rev=398793&r1=398792&r2=398793&view=diff
==============================================================================
--- webservices/axis2/trunk/java/modules/integration/src/test/soap12testing/client/SOAPCreater.java (original)
+++ webservices/axis2/trunk/java/modules/integration/src/test/soap12testing/client/SOAPCreater.java Mon May  1 20:38:53 2006
@@ -17,6 +17,7 @@
 package test.soap12testing.client;
 
 import org.apache.axiom.om.OMXMLParserWrapper;
+import org.apache.axiom.om.util.StAXUtils;
 import org.apache.axiom.soap.SOAP12Constants;
 import org.apache.axiom.soap.SOAPEnvelope;
 import org.apache.axiom.soap.impl.builder.StAXSOAPModelBuilder;
@@ -63,7 +64,7 @@
         File file = new File(pathAndFileName);
         try {
             XMLStreamReader parser =
-                XMLInputFactory.newInstance().createXMLStreamReader(new FileReader(file));
+                StAXUtils.createXMLStreamReader(new FileReader(file));
             OMXMLParserWrapper builder = new StAXSOAPModelBuilder(parser, null);
             return (SOAPEnvelope) builder.getDocumentElement();
         } catch (Exception e) {

Modified: webservices/axis2/trunk/java/modules/integration/test/org/apache/axis2/engine/FaultHandlingTest.java
URL: http://svn.apache.org/viewcvs/webservices/axis2/trunk/java/modules/integration/test/org/apache/axis2/engine/FaultHandlingTest.java?rev=398793&r1=398792&r2=398793&view=diff
==============================================================================
--- webservices/axis2/trunk/java/modules/integration/test/org/apache/axis2/engine/FaultHandlingTest.java (original)
+++ webservices/axis2/trunk/java/modules/integration/test/org/apache/axis2/engine/FaultHandlingTest.java Mon May  1 20:38:53 2006
@@ -21,6 +21,7 @@
 import junit.framework.TestSuite;
 import org.apache.axiom.om.OMAbstractFactory;
 import org.apache.axiom.om.OMElement;
+import org.apache.axiom.om.util.StAXUtils;
 import org.apache.axiom.soap.SOAP11Constants;
 import org.apache.axiom.soap.SOAP12Constants;
 import org.apache.axiom.soap.SOAPEnvelope;
@@ -139,7 +140,9 @@
                 "         <m:echoIn xmlns:m=\"http://example.org/echo\" />  \n" +
                 "      </env:Body>\n" +
                 "   </env:Envelope>";
-        return (SOAPEnvelope) new StAXSOAPModelBuilder(XMLInputFactory.newInstance().createXMLStreamReader(new ByteArrayInputStream(soap.getBytes())), SOAP12Constants.SOAP_ENVELOPE_NAMESPACE_URI).getDocumentElement();
+        return (SOAPEnvelope) new StAXSOAPModelBuilder(StAXUtils.createXMLStreamReader(
+                new ByteArrayInputStream(soap.getBytes())),
+                SOAP12Constants.SOAP_ENVELOPE_NAMESPACE_URI).getDocumentElement();
     }
 
     private SOAPEnvelope getResponse(SOAPEnvelope inEnvelope) throws AxisFault {

Modified: webservices/axis2/trunk/java/modules/integration/test/org/apache/axis2/engine/HandlerFailureTest.java
URL: http://svn.apache.org/viewcvs/webservices/axis2/trunk/java/modules/integration/test/org/apache/axis2/engine/HandlerFailureTest.java?rev=398793&r1=398792&r2=398793&view=diff
==============================================================================
--- webservices/axis2/trunk/java/modules/integration/test/org/apache/axis2/engine/HandlerFailureTest.java (original)
+++ webservices/axis2/trunk/java/modules/integration/test/org/apache/axis2/engine/HandlerFailureTest.java Mon May  1 20:38:53 2006
@@ -24,6 +24,7 @@
 import org.apache.axiom.om.OMAbstractFactory;
 import org.apache.axiom.om.OMElement;
 import org.apache.axiom.om.OMNamespace;
+import org.apache.axiom.om.util.StAXUtils;
 import org.apache.axiom.soap.SOAPFactory;
 import org.apache.axis2.AxisFault;
 import org.apache.axis2.Constants;
@@ -109,7 +110,7 @@
             OMElement result = sender.sendReceive(method);
 
 
-            result.serializeAndConsume(XMLOutputFactory.newInstance().createXMLStreamWriter(
+            result.serializeAndConsume(StAXUtils.createXMLStreamWriter(
                     System.out));
             fail("the test must fail due to the intentional failure of the \"culprit\" handler");
         } catch (AxisFault e) {

Modified: webservices/axis2/trunk/java/modules/integration/test/org/apache/axis2/groovy/GroovyServiceTest.java
URL: http://svn.apache.org/viewcvs/webservices/axis2/trunk/java/modules/integration/test/org/apache/axis2/groovy/GroovyServiceTest.java?rev=398793&r1=398792&r2=398793&view=diff
==============================================================================
--- webservices/axis2/trunk/java/modules/integration/test/org/apache/axis2/groovy/GroovyServiceTest.java (original)
+++ webservices/axis2/trunk/java/modules/integration/test/org/apache/axis2/groovy/GroovyServiceTest.java Mon May  1 20:38:53 2006
@@ -20,6 +20,7 @@
 import org.apache.axiom.om.OMAbstractFactory;
 import org.apache.axiom.om.OMElement;
 import org.apache.axiom.om.OMFactory;
+import org.apache.axiom.om.util.StAXUtils;
 import org.apache.axiom.om.impl.builder.StAXOMBuilder;
 import org.apache.axis2.Constants;
 import org.apache.axis2.addressing.EndpointReference;
@@ -113,7 +114,7 @@
                 "<GENDER>Male</GENDER></DET><DET><NAME>Sriskantharaja Ahilan</NAME>" +
                 "<OCC>Student</OCC><ADD>Trincomalee</ADD><GENDER>Male</GENDER>" +
                 "</DET></ADDRESS>";
-        XMLStreamReader xmlReader = XMLInputFactory.newInstance().createXMLStreamReader(new
+        XMLStreamReader xmlReader = StAXUtils.createXMLStreamReader(new
                 ByteArrayInputStream(str.getBytes()));
         OMFactory fac = OMAbstractFactory.getOMFactory();
 

Modified: webservices/axis2/trunk/java/modules/integration/test/org/apache/axis2/jms/JMSEchoRawXMLTest.java
URL: http://svn.apache.org/viewcvs/webservices/axis2/trunk/java/modules/integration/test/org/apache/axis2/jms/JMSEchoRawXMLTest.java?rev=398793&r1=398792&r2=398793&view=diff
==============================================================================
--- webservices/axis2/trunk/java/modules/integration/test/org/apache/axis2/jms/JMSEchoRawXMLTest.java (original)
+++ webservices/axis2/trunk/java/modules/integration/test/org/apache/axis2/jms/JMSEchoRawXMLTest.java Mon May  1 20:38:53 2006
@@ -22,6 +22,7 @@
 import org.apache.axiom.om.OMElement;
 import org.apache.axiom.om.OMFactory;
 import org.apache.axiom.om.OMNamespace;
+import org.apache.axiom.om.util.StAXUtils;
 import org.apache.axiom.soap.SOAPFactory;
 import org.apache.axiom.soap.SOAPEnvelope;
 import org.apache.axis2.AxisFault;
@@ -115,7 +116,7 @@
         Callback callback = new Callback() {
             public void onComplete(AsyncResult result) {
                 try {
-                    result.getResponseEnvelope().serialize(XMLOutputFactory.newInstance()
+                    result.getResponseEnvelope().serialize(StAXUtils
                             .createXMLStreamWriter(System.out));
                 } catch (XMLStreamException e) {
                     onError(e);
@@ -158,7 +159,7 @@
         OMElement result = sender.sendReceive(operationName, payload);
 
 
-        result.serialize(XMLOutputFactory.newInstance().createXMLStreamWriter(
+        result.serialize(StAXUtils.createXMLStreamWriter(
                 System.out));
 
     }
@@ -185,7 +186,7 @@
         sender.setOptions(options);
         OMElement result = sender.sendReceive(operationName, payloadElement);
 
-        result.serialize(XMLOutputFactory.newInstance().createXMLStreamWriter(
+        result.serialize(StAXUtils.createXMLStreamWriter(
                 System.out));
 
     }
@@ -227,7 +228,7 @@
         MessageContext response = opClient.getMessageContext(WSDLConstants.MESSAGE_LABEL_IN_VALUE);
         SOAPEnvelope env = response.getEnvelope();
         assertNotNull(env);
-        env.getBody().serialize(XMLOutputFactory.newInstance().createXMLStreamWriter(
+        env.getBody().serialize(StAXUtils.createXMLStreamWriter(
                 System.out));
         sender.finalizeInvoke();
     }

Modified: webservices/axis2/trunk/java/modules/integration/test/org/apache/axis2/mail/MailRequestResponseRawXMLTest.java
URL: http://svn.apache.org/viewcvs/webservices/axis2/trunk/java/modules/integration/test/org/apache/axis2/mail/MailRequestResponseRawXMLTest.java?rev=398793&r1=398792&r2=398793&view=diff
==============================================================================
--- webservices/axis2/trunk/java/modules/integration/test/org/apache/axis2/mail/MailRequestResponseRawXMLTest.java (original)
+++ webservices/axis2/trunk/java/modules/integration/test/org/apache/axis2/mail/MailRequestResponseRawXMLTest.java Mon May  1 20:38:53 2006
@@ -23,6 +23,7 @@
 import org.apache.axiom.om.OMElement;
 import org.apache.axiom.om.OMFactory;
 import org.apache.axiom.om.OMNamespace;
+import org.apache.axiom.om.util.StAXUtils;
 import org.apache.axiom.soap.SOAPEnvelope;
 import org.apache.axis2.AxisFault;
 import org.apache.axis2.Constants;
@@ -132,7 +133,7 @@
             public void onComplete(AsyncResult result) {
                 try {
                     result.getResponseEnvelope().serializeAndConsume(
-                            XMLOutputFactory.newInstance()
+                            StAXUtils
                                     .createXMLStreamWriter(System.out));
                 } catch (XMLStreamException e) {
                     onError(e);

Modified: webservices/axis2/trunk/java/modules/integration/test/org/apache/axis2/mail/MailetRequestResponseRawXMLTest.java
URL: http://svn.apache.org/viewcvs/webservices/axis2/trunk/java/modules/integration/test/org/apache/axis2/mail/MailetRequestResponseRawXMLTest.java?rev=398793&r1=398792&r2=398793&view=diff
==============================================================================
--- webservices/axis2/trunk/java/modules/integration/test/org/apache/axis2/mail/MailetRequestResponseRawXMLTest.java (original)
+++ webservices/axis2/trunk/java/modules/integration/test/org/apache/axis2/mail/MailetRequestResponseRawXMLTest.java Mon May  1 20:38:53 2006
@@ -22,6 +22,7 @@
 import org.apache.axiom.om.OMElement;
 import org.apache.axiom.om.OMFactory;
 import org.apache.axiom.om.OMNamespace;
+import org.apache.axiom.om.util.StAXUtils;
 import org.apache.axiom.soap.SOAPEnvelope;
 import org.apache.axis2.AxisFault;
 import org.apache.axis2.Constants;
@@ -120,7 +121,7 @@
             public void onComplete(AsyncResult result) {
                 try {
                     result.getResponseEnvelope().serializeAndConsume(
-                            XMLOutputFactory.newInstance()
+                            StAXUtils
                                     .createXMLStreamWriter(System.out));
                 } catch (XMLStreamException e) {
                     onError(e);

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=398793&r1=398792&r2=398793&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 May  1 20:38:53 2006
@@ -167,8 +167,6 @@
         options.setTo(targetEPR);
         OMElement result = sender.sendReceive(payload);
 
-        // result.serializeAndConsume(new
-        // OMOutput(XMLOutputFactory.newInstance().createXMLStreamWriter(System.out)));
         OMElement ele = (OMElement) result.getFirstOMChild();
         OMText binaryNode = (OMText) ele.getFirstOMChild();
 
@@ -180,9 +178,6 @@
         actualDH = (DataHandler) binaryNode.getDataHandler();
         new ImageIO().loadImage(actualDH.getDataSource()
                 .getInputStream());
-//        FileOutputStream imageOutStream = new FileOutputStream("target/testout.jpg");
-//        new ImageIO().saveImage("image/jpeg", actualObject, imageOutStream);
-
     }
 
     protected InputStream getResourceAsStream(String path) {

Modified: webservices/axis2/trunk/java/modules/integration/test/org/apache/axis2/rpc/MultirefTest.java
URL: http://svn.apache.org/viewcvs/webservices/axis2/trunk/java/modules/integration/test/org/apache/axis2/rpc/MultirefTest.java?rev=398793&r1=398792&r2=398793&view=diff
==============================================================================
--- webservices/axis2/trunk/java/modules/integration/test/org/apache/axis2/rpc/MultirefTest.java (original)
+++ webservices/axis2/trunk/java/modules/integration/test/org/apache/axis2/rpc/MultirefTest.java Mon May  1 20:38:53 2006
@@ -23,6 +23,7 @@
 import org.apache.axiom.om.OMElement;
 import org.apache.axiom.om.OMFactory;
 import org.apache.axiom.om.OMNamespace;
+import org.apache.axiom.om.util.StAXUtils;
 import org.apache.axiom.om.impl.builder.StAXOMBuilder;
 import org.apache.axiom.soap.SOAPEnvelope;
 import org.apache.axiom.soap.SOAPFactory;
@@ -496,7 +497,7 @@
     private OMElement getOMelemnt(String str, OMFactory fac) throws AxisFault {
         StAXOMBuilder staxOMBuilder;
         try {
-            XMLStreamReader xmlReader = XMLInputFactory.newInstance().createXMLStreamReader(new
+            XMLStreamReader xmlReader = StAXUtils.createXMLStreamReader(new
                     ByteArrayInputStream(str.getBytes()));
             staxOMBuilder = new
                     StAXOMBuilder(fac, xmlReader);
@@ -592,7 +593,7 @@
                 "</reference>";
         StAXOMBuilder staxOMBuilder;
         try {
-            XMLStreamReader xmlReader = XMLInputFactory.newInstance().createXMLStreamReader(new
+            XMLStreamReader xmlReader = StAXUtils.createXMLStreamReader(new
                     ByteArrayInputStream(str.getBytes()));
             staxOMBuilder = new
                     StAXOMBuilder(fac, xmlReader);

Modified: webservices/axis2/trunk/java/modules/integration/test/org/apache/axis2/rpc/RPCCallTest.java
URL: http://svn.apache.org/viewcvs/webservices/axis2/trunk/java/modules/integration/test/org/apache/axis2/rpc/RPCCallTest.java?rev=398793&r1=398792&r2=398793&view=diff
==============================================================================
--- webservices/axis2/trunk/java/modules/integration/test/org/apache/axis2/rpc/RPCCallTest.java (original)
+++ webservices/axis2/trunk/java/modules/integration/test/org/apache/axis2/rpc/RPCCallTest.java Mon May  1 20:38:53 2006
@@ -22,6 +22,7 @@
 import org.apache.axiom.om.OMAbstractFactory;
 import org.apache.axiom.om.OMElement;
 import org.apache.axiom.om.OMFactory;
+import org.apache.axiom.om.util.StAXUtils;
 import org.apache.axiom.om.impl.builder.StAXOMBuilder;
 import org.apache.axis2.AxisFault;
 import org.apache.axis2.Constants;
@@ -684,7 +685,7 @@
                 "</req:omElementArray>";
         StAXOMBuilder staxOMBuilder;
         try {
-            XMLStreamReader xmlReader = XMLInputFactory.newInstance().createXMLStreamReader(new
+            XMLStreamReader xmlReader = StAXUtils.createXMLStreamReader(new
                     ByteArrayInputStream(str.getBytes()));
             OMFactory fac = OMAbstractFactory.getOMFactory();
 
@@ -719,7 +720,7 @@
                 "</req:handleArrayList>";
         StAXOMBuilder staxOMBuilder;
         try {
-            XMLStreamReader xmlReader = XMLInputFactory.newInstance().createXMLStreamReader(new
+            XMLStreamReader xmlReader = StAXUtils.createXMLStreamReader(new
                     ByteArrayInputStream(str.getBytes()));
             OMFactory fac = OMAbstractFactory.getOMFactory();
 

Modified: webservices/axis2/trunk/java/modules/integration/test/org/apache/axis2/security/rahas/TestClient.java
URL: http://svn.apache.org/viewcvs/webservices/axis2/trunk/java/modules/integration/test/org/apache/axis2/security/rahas/TestClient.java?rev=398793&r1=398792&r2=398793&view=diff
==============================================================================
--- webservices/axis2/trunk/java/modules/integration/test/org/apache/axis2/security/rahas/TestClient.java (original)
+++ webservices/axis2/trunk/java/modules/integration/test/org/apache/axis2/security/rahas/TestClient.java Mon May  1 20:38:53 2006
@@ -19,6 +19,7 @@
 import org.apache.axiom.om.OMElement;
 import org.apache.axiom.om.OMFactory;
 import org.apache.axiom.om.OMNamespace;
+import org.apache.axiom.om.util.StAXUtils;
 import org.apache.axis2.AxisFault;
 import org.apache.axis2.Constants;
 import org.apache.axis2.addressing.EndpointReference;
@@ -101,7 +102,7 @@
             OMElement result = serviceClient.sendReceive(getEchoElement());
             
             StringWriter writer = new StringWriter();
-            result.serialize(XMLOutputFactory.newInstance()
+            result.serialize(StAXUtils
                     .createXMLStreamWriter(writer));
             writer.flush();