Examples of OMOutputImpl


Examples of org.apache.axis2.om.impl.OMOutputImpl

    public void testImageSampleSerialize() throws Exception {

        outMTOMFile = new File(outFileName);
        outBase64File = new File(outBase64FileName);
        org.apache.axis2.om.impl.OMOutputImpl mtomOutput = new OMOutputImpl(new FileOutputStream(outMTOMFile),
                true);
        org.apache.axis2.om.impl.OMOutputImpl baseOutput = new OMOutputImpl(new FileOutputStream(outBase64File),
                false);

        OMNamespaceImpl soap = new OMNamespaceImpl(
                "http://schemas.xmlsoap.org/soap/envelope/", "soap");
        OMElement envelope = new OMElementImpl("Envelope", soap);
        OMElement body = new OMElementImpl("Body", soap);

        OMNamespaceImpl dataName = new OMNamespaceImpl(
                "http://www.example.org/stuff", "m");
        OMElement data = new OMElementImpl("data", dataName);

        expectedImage =
                new ImageIO().loadImage(
                        new FileInputStream(
                                getTestResourceFile(imageInFileName)));
        ImageDataSource dataSource = new ImageDataSource("WaterLilies.jpg",
                expectedImage);
        expectedDH = new DataHandler(dataSource);
        OMText binaryNode = new OMTextImpl(expectedDH, true);

        envelope.addChild(body);
        body.addChild(data);
        data.addChild(binaryNode);

        envelope.serialize(baseOutput);
        baseOutput.flush();

        envelope.serialize(mtomOutput);
        mtomOutput.flush();
    }
View Full Code Here

Examples of org.apache.axis2.om.impl.OMOutputImpl

    ByteArrayOutputStream byteOutStr = new ByteArrayOutputStream();
   
    XMLStreamWriter writer = XMLOutputFactory
        .newInstance().createXMLStreamWriter(byteOutStr,UTF_16);
    OMOutputImpl outputImpl = new OMOutputImpl(writer);
        outputImpl.setCharSetEncoding(UTF_16);
    envelope.serializeWithCache(outputImpl);
    outputImpl.flush();
   
    ByteArrayInputStream byteInStr = new ByteArrayInputStream(byteOutStr.toByteArray());
   
    StAXSOAPModelBuilder builder = new StAXSOAPModelBuilder(XMLInputFactory.newInstance().createXMLStreamReader(byteInStr, UTF_16),null);
View Full Code Here

Examples of org.apache.axis2.om.impl.OMOutputImpl

                // create file
                checkFile(parse1File);
                checkFile(parse2File);

                FileOutputStream outStream = new FileOutputStream(parse1File);
                OMOutputImpl output = new OMOutputImpl(outStream, false);
                omDocument.serialize(output);
                output.flush();
                outStream.close();

                BufferedWriter out = new BufferedWriter(new FileWriter("filename", true));

                // read the file again and serialise
                FileInputStream inStream = new FileInputStream(parse1File);
                StAXOMBuilder builder = new StAXOMBuilder(inStream);
                builder.getDocumentElement().build();

                output = new OMOutputImpl(new FileOutputStream(parse2File), false);
                omDocument.serialize(output);
                output.flush();
                inStream.close();
                System.out.println("Completed File Size is " + (parse1File.length() / 1024) + "kB");

                // no problem ? increase the size and repeat
                increaseXMLSize();
View Full Code Here

Examples of org.apache.axis2.om.impl.OMOutputImpl

        FileInputStream inStream = new FileInputStream(parse1File);
        StAXOMBuilder builder = new StAXOMBuilder(inStream);
        builder.getDocumentElement().build();

        OMOutputImpl output = new OMOutputImpl(new FileOutputStream(parse2File), false);
        omDocument.serialize(output);
        output.flush();
        inStream.close();
        System.out.println("Completed File Size is " + (parse1File.length() / 1024) + "kB");
    }
View Full Code Here

Examples of org.apache.axis2.om.impl.OMOutputImpl

            SOAPComparator soapComparator = new SOAPComparator();
            //ignore elements that belong to the addressing namespace
            soapComparator.addIgnorableNamespace("http://schemas.xmlsoap.org/ws/2004/08/addressing");
//            ////////////////////////////////////////////////////
            System.out.println("######################################################");
            OMOutputImpl omOutput = new OMOutputImpl(System.out,false);
            requiredMessageEnvelope.serializeWithCache(omOutput);
            omOutput.flush();
            System.out.println("");
            System.out.println("-------------------------------------------------------");
           OMOutputImpl omOutput1 = new OMOutputImpl(System.out,false);
            replyMessageEnvelope.serializeWithCache(omOutput1);
            omOutput1.flush();
            System.out.println("");
                   System.out.println("`######################################################");
            /////////////////////////////////////////////////////

View Full Code Here

Examples of org.apache.axis2.om.impl.OMOutputImpl

      env.build();
      /**
       * There are plans to deprecate the OmNode.serialize(XMLStreamWriter)
       * method therefore using OMOutoutImpl to serialize the env
       */
      OMOutputImpl output = new OMOutputImpl(baos, false);
      env.serialize(output);
      output.flush();
     
      ByteArrayInputStream bais = new ByteArrayInputStream(baos.toByteArray());

      DocumentBuilderFactory factory = DocumentBuilderFactory.newInstance();
      factory.setNamespaceAware(true);
View Full Code Here

Examples of org.apache.axis2.om.impl.OMOutputImpl

     * @throws javax.xml.stream.XMLStreamException
     *
     * @see #serialize(org.apache.axis2.om.impl.OMOutputImpl)
     */
    public void serialize(XMLStreamWriter xmlWriter) throws XMLStreamException {
        OMOutputImpl omOutput = new OMOutputImpl(xmlWriter);
        serialize(omOutput);
        omOutput.flush();
    }
View Full Code Here

Examples of org.apache.axis2.om.impl.OMOutputImpl

     * @throws javax.xml.stream.XMLStreamException
     *
     * @see #serializeAndConsume(org.apache.axis2.om.impl.OMOutputImpl)
     */
    public void serializeAndConsume(XMLStreamWriter xmlWriter) throws XMLStreamException {
        OMOutputImpl omOutput = new OMOutputImpl(xmlWriter);
        serializeAndConsume(omOutput);
        omOutput.flush();
    }
View Full Code Here

Examples of org.apache.axis2.om.impl.OMOutputImpl

    public void serializeAndConsume(Writer writer) throws XMLStreamException {
        serializeAndConsume(XMLOutputFactory.newInstance().createXMLStreamWriter(writer));
    }

    public void serialize(OutputStream output, OMOutputFormat format) throws XMLStreamException {   
        OMOutputImpl omOutput = new  OMOutputImpl(output, format);
        serialize(omOutput);
        omOutput.flush();
    }
View Full Code Here

Examples of org.apache.axis2.om.impl.OMOutputImpl

        serialize(omOutput);
        omOutput.flush();
    }

    public void serialize(Writer writer, OMOutputFormat format) throws XMLStreamException {
        OMOutputImpl omOutput = new  OMOutputImpl(XMLOutputFactory.newInstance().createXMLStreamWriter(writer));
        omOutput.setOutputFormat(format);
        serialize(omOutput);
        omOutput.flush();
    }
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.