Examples of OMOutputImpl


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

                                                 -1<xmlDocument.indexOf(version2));
  }

  public void testXMLVersion_11() throws XMLStreamException {
    ByteArrayOutputStream baos = new ByteArrayOutputStream();
    OMOutputImpl output = new OMOutputImpl(baos,false);
    document.setXMLVersion("1.1");
    document.serialize(output);
    output.flush();
   
    String xmlDocument = new String(baos.toByteArray());
    assertTrue("Charset declaration missing",-1<xmlDocument.indexOf(version_11) ||
                                                 -1<xmlDocument.indexOf(version2_11));
  }
View Full Code Here

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

        OMElement person = (OMElement)result.getFirstChild();
        assertEquals(person.getLocalName(),"person");

        StringWriter writer = new StringWriter();
        result.build();
        result.serializeWithCache(new OMOutputImpl(XMLOutputFactory.newInstance().createXMLStreamWriter(writer)));
        writer.flush();
        call.close();
    }
View Full Code Here

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

    /**
     * @see javax.xml.soap.SOAPMessage#writeTo(java.io.OutputStream)
     */
    public void writeTo(OutputStream out) throws SOAPException, IOException {
        try {
            OMOutputImpl output = new OMOutputImpl();
            output.setCharSetEncoding((String)getProperty(CHARACTER_SET_ENCODING));
            String writeXmlDecl = (String)getProperty(WRITE_XML_DECLARATION);
            if(writeXmlDecl==null || writeXmlDecl.equals("false")) { //SAAJ default case doesn't send XML decl
              output.ignoreXMLDeclaration(true);
            }
            output.setOutputStream(out, false);
            //the writeTo method forces the elements to be built!!!
            ((SOAPEnvelopeImpl) mSOAPPart.getEnvelope()).getOMEnvelope()
                    .serializeWithCache(output);
            output.flush();
        } catch (Exception e) {
            throw new SOAPException(e);
        }
    }
View Full Code Here

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

     * @throws javax.xml.stream.XMLStreamException
     *
     * @see #serializeWithCache(org.apache.axis2.om.impl.OMOutputImpl)
     */
    public void serializeWithCache(XMLStreamWriter xmlWriter) throws XMLStreamException {
        OMOutputImpl omOutput = new OMOutputImpl(xmlWriter);
        serializeWithCache(omOutput);
        omOutput.flush();
    }
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

            if (descriptionElement !=null) {
                OMElement descriptionValue = descriptionElement.getFirstElement();
                if(descriptionValue !=null){
                    StringWriter writer = new StringWriter();
                    descriptionValue.build();
                    descriptionValue.serializeWithCache(new
                            OMOutputImpl(XMLOutputFactory.newInstance().createXMLStreamWriter(writer)));
                    writer.flush();
                    service.setServiceDescription(writer.toString());
                } else {
                    service.setServiceDescription(descriptionElement.getText());
View Full Code Here

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

                if (!doingMTOM) {
                    XMLStreamWriter outputWriter =
                            XMLOutputFactory.newInstance()
                            .createXMLStreamWriter(bytesOut,
                                    charSetEnc);
                    OMOutputImpl output = new OMOutputImpl(outputWriter);
                    output.setCharSetEncoding(charSetEnc);
                    element.serialize(output);
                    output.flush();
                    return bytesOut.toByteArray();
                } else {
                    omOutput.setCharSetEncoding(charSetEnc);
                    omOutput.setOutputStream(bytesOut, true)//changed...
                    element.serialize(omOutput);
View Full Code Here

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

     * @param writer
     * @throws XMLStreamException
     */
    public void serialize(XMLStreamReader node, XMLStreamWriter writer)
            throws XMLStreamException {
        serializeNode(node, new OMOutputImpl(writer));
    }
View Full Code Here

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

                (OMElement) inMessage.getEnvelope().getBody().getFirstChild();
            inMessage.getEnvelope().build();
            StringWriter writer = new StringWriter();
            firstChild.build();
            firstChild.serializeWithCache(
                new OMOutputImpl(
                    XMLOutputFactory.newInstance().createXMLStreamWriter(
                        writer)));
            writer.flush();
            String value = writer.toString();
            if (value != null) {
View Full Code Here

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

                (OMElement) inMessage.getEnvelope().getBody().getFirstChild();
            inMessage.getEnvelope().build();
            StringWriter writer = new StringWriter();
            firstChild.build();
            firstChild.serializeWithCache(
                new OMOutputImpl(
                    XMLOutputFactory.newInstance().createXMLStreamWriter(
                        writer)));
            writer.flush();
            String value = writer.toString();
            if (value != null) {
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.