Package com.sun.xml.fastinfoset.stax

Examples of com.sun.xml.fastinfoset.stax.StAXDocumentSerializer.writeEndDocument()


            xsw.writeStartDocument();
            xsw.writeStartElement(rootElement);
            for (Object o : t)
                m.marshal(o, xsw);
            xsw.writeEndElement();
            xsw.writeEndDocument();
            xsw.flush();
        } catch (XMLStreamException cause) {
            throw ThrowHelper.withInitCause(cause,
                    new IOException()
                    );           
View Full Code Here


            // output it using binary xml outputter
            XMLStreamWriter streamWriter = new StAXDocumentSerializer(new FileOutputStream(tempFile));
            streamWriter.writeStartDocument();
            element.serializeAndConsume(streamWriter);
            streamWriter.writeEndDocument();

            // now let's read the binary file in to Axiom
            XMLStreamReader streamReader = new StAXDocumentParser(new FileInputStream(tempFile));
            StAXBuilder builder = new StAXOMBuilder(streamReader);
            builder.getDocumentElement().serialize(new FileWriter(outputFile));
View Full Code Here

      //Creates StAX document serializer which actually implements the XMLStreamWriter
      XMLStreamWriter streamWriter = new StAXDocumentSerializer(outStream);
      //Since we drop the SOAP envelop we have to manually write the start document and the end document events
      streamWriter.writeStartDocument();
      element.serializeAndConsume(streamWriter);
      streamWriter.writeEndDocument();
     
      return outStream.toByteArray();
     
    } catch (XMLStreamException xmlse) {
      logger.error(xmlse.getMessage());
View Full Code Here

      if (preserve) {
        element.serialize(streamWriter);
      } else {
        element.serializeAndConsume(streamWriter);
      }
      streamWriter.writeEndDocument();
    } catch (XMLStreamException xmlse) {
      logger.error(xmlse.getMessage());
      throw new AxisFault(xmlse.getMessage(), xmlse);
    }
  }
View Full Code Here

    try {
      //Creates StAX document serializer which actually implements the XMLStreamWriter
      XMLStreamWriter streamWriter = new StAXDocumentSerializer(outStream);
      element.serializeAndConsume(streamWriter);
      //TODO Looks like the SOAP envelop doesn't have an end document tag. Find out why?
      streamWriter.writeEndDocument();
     
      return outStream.toByteArray();
     
    } catch (XMLStreamException xmlse) {
      logger.error(xmlse.getMessage());
View Full Code Here

        element.serialize(streamWriter);
      } else {
        element.serializeAndConsume(streamWriter);
      }
//      TODO Looks like the SOAP envelop doesn't have a end document tag. Find out why?
      streamWriter.writeEndDocument();
    } catch (XMLStreamException xmlse) {
      logger.error(xmlse.getMessage());
      throw new AxisFault(xmlse.getMessage(), xmlse);
    }
  }
View Full Code Here

            // output it using binary xml outputter
            XMLStreamWriter streamWriter = new StAXDocumentSerializer(new FileOutputStream(tempFile));
            streamWriter.writeStartDocument();
            element.serializeAndConsume(streamWriter);
            streamWriter.writeEndDocument();

            // now let's read the binary file in to Axiom
            XMLStreamReader streamReader = new StAXDocumentParser(new FileInputStream(tempFile));
            StAXBuilder builder = new StAXOMBuilder(streamReader);
            builder.getDocumentElement().serialize(new FileWriter(outputFile));
View Full Code Here

      //Creates StAX document serializer which actually implements the XMLStreamWriter
      XMLStreamWriter streamWriter = new StAXDocumentSerializer(outStream);
      //Since we drop the SOAP envelop we have to manually write the start document and the end document events
      streamWriter.writeStartDocument();
      element.serializeAndConsume(streamWriter);
      streamWriter.writeEndDocument();
     
      return outStream.toByteArray();
     
    } catch (XMLStreamException xmlse) {
      logger.error(xmlse.getMessage());
View Full Code Here

      if (preserve) {
        element.serialize(streamWriter);
      } else {
        element.serializeAndConsume(streamWriter);
      }
      streamWriter.writeEndDocument();
    } catch (XMLStreamException xmlse) {
      logger.error(xmlse.getMessage());
      throw new AxisFault(xmlse.getMessage(), xmlse);
    }
  }
View Full Code Here

    try {
      //Creates StAX document serializer which actually implements the XMLStreamWriter
      XMLStreamWriter streamWriter = new StAXDocumentSerializer(outStream);
      element.serializeAndConsume(streamWriter);
      //TODO Looks like the SOAP envelop doesn't have an end document tag. Find out why?
      streamWriter.writeEndDocument();
     
      return outStream.toByteArray();
     
    } catch (XMLStreamException xmlse) {
      logger.error(xmlse.getMessage());
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.