Package org.apache.axis2.om.impl

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


        super.setUp();
        SOAPFactory factory = OMAbstractFactory.getSOAP11Factory();
        ByteArrayOutputStream outStream;
        String boundary;
       
        OMOutputImpl omOutput = new OMOutputImpl(null);
        boundary = omOutput.getMimeBoundary();

        String contentType = org.apache.axis2.om.impl.MIMEOutputUtils
        .getContentTypeForMime(boundary, omOutput.getRootContentId(),
            omOutput.getCharSetEncoding(),SOAP12Constants.SOAP_12_CONTENT_TYPE);
        DataHandler dataHandler;
        dataHandler = new DataHandler(new ByteArrayDataSource(byteArray));
        OMText textData = factory.createText(dataHandler, true);
        assertNotNull(textData.getContentID());
View Full Code Here


  }

 
  public void testXMLDecleration() throws XMLStreamException {
    ByteArrayOutputStream baos = new ByteArrayOutputStream();
    OMOutputImpl output = new OMOutputImpl(baos,false);
    document.serialize(output);
    output.flush();
   
    String xmlDocuemnt = new String(baos.toByteArray());
   
    assertTrue("XML Declaration missing",-1<xmlDocuemnt.indexOf(xmlDeclStart));
  }
View Full Code Here

    assertTrue("XML Declaration missing",-1<xmlDocuemnt.indexOf(xmlDeclStart));
  }
 
  public void testExcludeXMLDeclaration() throws XMLStreamException {
    ByteArrayOutputStream baos = new ByteArrayOutputStream();
    OMOutputImpl output = new OMOutputImpl(baos,false);
    document.serialize(output,false);
    output.flush();
   
    String xmlDocuemnt = new String(baos.toByteArray());
   
    assertTrue(
        "XML Declaration is included when serilizing without the declaration",
View Full Code Here

        -1 == xmlDocuemnt.indexOf(xmlDeclStart));   
  }
 
  public void testCharsetEncoding() throws XMLStreamException {
    ByteArrayOutputStream baos = new ByteArrayOutputStream();
    OMOutputImpl output = new OMOutputImpl(baos,false);
    document.serialize(output);
    output.flush();
   
    String xmlDocuemnt = new String(baos.toByteArray());
   
    assertTrue("Charset declaration missing",-1<xmlDocuemnt.indexOf(encoding));   
  }
View Full Code Here

    assertTrue("Charset declaration missing",-1<xmlDocuemnt.indexOf(encoding));   
  }
 
  public void testCharsetEncodingUTF_16() throws XMLStreamException {
    ByteArrayOutputStream baos = new ByteArrayOutputStream();
    OMOutputImpl output = new OMOutputImpl(baos,false);
    output.setCharSetEncoding("UTF-16");
    document.serialize(output);
    output.flush();
   
    String xmlDocuemnt = new String(baos.toByteArray());
    assertTrue("Charset declaration missing",-1<xmlDocuemnt.indexOf(encoding_UTF16));   
  }
View Full Code Here

  }
   
 
  public void testXMLVersion() throws XMLStreamException {
    ByteArrayOutputStream baos = new ByteArrayOutputStream();
    OMOutputImpl output = new OMOutputImpl(baos,false);
    document.serialize(output);
    output.flush();
   
    String xmlDocuemnt = new String(baos.toByteArray());
    assertTrue("Charset declaration missing",-1<xmlDocuemnt.indexOf(version));   
  }
View Full Code Here

    assertTrue("Charset declaration missing",-1<xmlDocuemnt.indexOf(version));   
  }

  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 xmlDocuemnt = new String(baos.toByteArray());
    assertTrue("Charset declaration missing",-1<xmlDocuemnt.indexOf(version_11));   
  }
View Full Code Here

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

    OMNamespace namespace1 = factory.createOMNamespace("","");
    OMElement elem1 = factory.createOMElement("",namespace1);

    StringWriter writer = new StringWriter();
    elem1.build();
    elem1.serializeWithCache(new OMOutputImpl(XMLOutputFactory
        .newInstance().createXMLStreamWriter(writer)));
    writer.flush();
    return writer.toString();
  }
View Full Code Here

    ByteArrayOutputStream byteOutStr = new ByteArrayOutputStream();
   
    XMLStreamWriter writer = XMLOutputFactory
        .newInstance().createXMLStreamWriter(byteOutStr,UTF_16);
    OMOutputImpl outputImpl = new OMOutputImpl(writer);
    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

TOP

Related Classes of org.apache.axis2.om.impl.OMOutputImpl

Copyright © 2018 www.massapicom. 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.