Package org.apache.axiom.om

Examples of org.apache.axiom.om.OMElement.serialize()


            // serialize and create an input stream to read WSDL
            ByteArrayOutputStream baos = new ByteArrayOutputStream();
            try {
                if (trace()) trace.info("Serializing wsdlElement found to build an Axis2 service");
                wsdlElement.serialize(baos);
                wsdlInputStream = new ByteArrayInputStream(baos.toByteArray());
            } catch (XMLStreamException e) {
                handleException("Error converting to a StreamSource", e);
            }
View Full Code Here


            // serialize and create an inputstream to read WSDL
            ByteArrayOutputStream baos = new ByteArrayOutputStream();
            try {
                if (trace()) trace.info("Serializing wsdlElement found to build an Axis2 service");
                wsdlElement.serialize(baos);
                wsdlInputStream = new ByteArrayInputStream(baos.toByteArray());
            } catch (XMLStreamException e) {
                handleException("Error converting to a StreamSource", e);
            }
View Full Code Here

            log.debug("Serializing the XML Configuration to the output stream");
        }

        OMElement definitions
                = ConfigurationFactoryAndSerializerFinder.serializeConfiguration(synCfg);
        definitions.serialize(outputStream);
    }
   
}
View Full Code Here

        (OMElement)base;
      if (om.getParent() != null && om.getParent() instanceof OMDocument) {
        OMDocument doc = (OMDocument) om.getParent();
        pw.writeStartDocument(doc.getCharsetEncoding(), doc.getXMLVersion());
      }
      om.serialize(pw);
      pw.writeEndDocument();
    } catch (XMLStreamException e) {
      throw new RuntimeException(e);
    }
  }
View Full Code Here

     */
    public void testCreateSerializeAndSerializeOptimized() throws Exception {
        OMElement root = createTestMTOMMessage();
       
        // Serialize the tree (with caching).
        root.serialize(new ByteArrayOutputStream());
       
        // Write out the source
        checkSerialization(root, true);
    }
   
View Full Code Here

    Iterator iter = body.getChildElements();
    InputStream mockInputStream = null;
    ByteArrayOutputStream os = new ByteArrayOutputStream();
    while(iter.hasNext()){
      OMElement om = (OMElement)iter.next();
      om.serialize(os);
      byte[] bArray = os.toByteArray();
      mockInputStream = new ByteArrayInputStream(bArray);
      break;
    }
    ((Data)peds.getObject()).setInputStream(mockInputStream);
View Full Code Here

       
        ByteArrayOutputStream baos = new ByteArrayOutputStream();
       
        // Apply the scenario
        if (scenario == Scenario.SER) {
            root.serialize(baos);
            String result = baos.toString("UTF-8");
            assertResult(result);
        } else if (scenario == Scenario.SER_SER) {
            root.serialize(baos);
            String result = baos.toString("UTF-8");
View Full Code Here

        if (scenario == Scenario.SER) {
            root.serialize(baos);
            String result = baos.toString("UTF-8");
            assertResult(result);
        } else if (scenario == Scenario.SER_SER) {
            root.serialize(baos);
            String result = baos.toString("UTF-8");
            assertResult(result);
            baos.reset();
            root.serialize(baos);
            result = baos.toString("UTF-8");
View Full Code Here

        } else if (scenario == Scenario.SER_SER) {
            root.serialize(baos);
            String result = baos.toString("UTF-8");
            assertResult(result);
            baos.reset();
            root.serialize(baos);
            result = baos.toString("UTF-8");
            assertResult(result);
        } else if (scenario == Scenario.SAC) {
            root.serializeAndConsume(baos);
            String result = baos.toString("UTF-8");
View Full Code Here

        } else if (scenario == Scenario.SAC) {
            root.serializeAndConsume(baos);
            String result = baos.toString("UTF-8");
            assertResult(result);
        } else if (scenario == Scenario.SER_SAC) {
            root.serialize(baos);
            String result = baos.toString("UTF-8");
            assertResult(result);
            baos.reset();
            root.serializeAndConsume(baos);
            result = baos.toString("UTF-8");
View Full Code Here

TOP
Copyright © 2018 www.massapi.com. All rights reserved.
All source code are property of their respective owners. Java is a trademark of Sun Microsystems, Inc and owned by ORACLE Inc. Contact coftware#gmail.com.