1 package org.apache.axis2.soap.impl.llom.soap11; 2 3 import org.apache.axis2.om.OMOutput; 4 import org.apache.axis2.om.OMTestCase; 5 import org.apache.axis2.soap.SOAPEnvelope; 6 import org.apache.axis2.soap.impl.llom.builder.StAXSOAPModelBuilder; 7 8 import javax.xml.stream.XMLOutputFactory; 9 import javax.xml.stream.XMLStreamException; 10 11 28 29 public class SOAP11SerializerTest extends OMTestCase{ 30 private OMOutput omOutput; 31 32 public SOAP11SerializerTest(String testName) { 33 super(testName); 34 } 35 36 protected StAXSOAPModelBuilder getOMBuilder(String fileName) throws Exception { 37 return super.getOMBuilder(fileName); 38 } 39 40 protected void setUp() throws Exception { 41 super.setUp(); 42 soapEnvelope = (SOAPEnvelope) getOMBuilder("soap/soap11/soap11fault.xml").getDocumentElement(); 43 omOutput = new OMOutput(XMLOutputFactory.newInstance(). 44 createXMLStreamWriter(System.out)); 45 } 46 47 public void testSerialize(){ 48 try { 49 soapEnvelope.serializeWithCache(omOutput); 50 omOutput.flush(); 51 52 System.out.println(""); 53 System.out.println("======================="); 54 soapEnvelope.serialize(omOutput); 55 omOutput.flush(); 56 } catch (XMLStreamException e) { 57 e.printStackTrace(); 58 } 59 60 } 61 } 62 | Popular Tags |