1 package org.apache.axis2.echo; 2 3 import org.apache.axis2.om.OMElement; 4 import org.apache.axis2.om.OMAbstractFactory; 5 import org.apache.axis2.om.OMXMLParserWrapper; 6 import org.apache.axis2.om.impl.llom.factory.OMXMLBuilderFactory; 7 8 import javax.xml.stream.XMLInputFactory; 9 import javax.xml.stream.XMLStreamReader; 10 import java.io.FileInputStream ; 11 import java.io.File ; 12 13 30 31 36 public class Echo { 37 38 public Echo() { 39 } 40 public OMElement viewVersion(OMElement omEle) { 41 File aFile = new File ("E:\\TestCase\\Soap.txt"); 42 FileInputStream inputFile = null; try { 44 inputFile = new FileInputStream (aFile); 45 XMLStreamReader xmlr = 46 null; 47 48 xmlr = XMLInputFactory.newInstance().createXMLStreamReader(inputFile); 49 OMXMLParserWrapper builder = 50 OMXMLBuilderFactory.createStAXOMBuilder(OMAbstractFactory.getOMFactory(), xmlr); 51 OMElement doc = builder.getDocumentElement(); 52 doc.build(); 53 return doc; 54 }catch(Exception e) { 55 return null; 56 } 57 58 } 59 60 } | Popular Tags |