Examples of writeEndDocument()


Examples of javax.xml.stream.XMLStreamWriter.writeEndDocument()

        m.setContent(XMLStreamWriter.class, writer);

        Soap11FaultOutInterceptorInternal.INSTANCE.handleMessage(m);

        writer.writeEndElement();
        writer.writeEndDocument();
        writer.close();

        Document faultDoc = StaxUtils.read(new ByteArrayInputStream(out.toByteArray()));
        assertValid("//s:Fault/faultcode[text()='ns1:Client']", faultDoc);
        assertValid("//s:Fault/faultstring[text()='" + faultString + "']", faultDoc);
View Full Code Here

Examples of javax.xml.stream.XMLStreamWriter.writeEndDocument()

        m.setContent(XMLStreamWriter.class, writer);

        Soap12FaultOutInterceptorInternal.INSTANCE.handleMessage(m);

        writer.writeEndElement();
        writer.writeEndDocument();
        writer.close();

        Document faultDoc = StaxUtils.read(new ByteArrayInputStream(out.toByteArray()));
       
        assertValid("//soap12env:Fault/soap12env:Code/soap12env:Value[text()='ns1:Sender']",
View Full Code Here

Examples of javax.xml.stream.XMLStreamWriter.writeEndDocument()

        m.setContent(XMLStreamWriter.class, writer);

        Soap12FaultOutInterceptorInternal.INSTANCE.handleMessage(m);

        writer.writeEndElement();
        writer.writeEndDocument();
        writer.close();

        Document faultDoc = StaxUtils.read(new ByteArrayInputStream(out.toByteArray()));
       
        assertValid("//soap12env:Fault/soap12env:Code/soap12env:Value[text()='ns1:Sender']",
View Full Code Here

Examples of javax.xml.stream.XMLStreamWriter.writeEndDocument()

                  new Annotation[]{}, MediaType.APPLICATION_JSON_TYPE,
                  new MetadataMap<String, String>(), is);
        ByteArrayOutputStream os = new ByteArrayOutputStream();
        XMLStreamWriter writer = StaxUtils.createXMLStreamWriter(os);
        StaxUtils.copy(doc, writer);
        writer.writeEndDocument();
        String s2 = os.toString();
        assertTrue(s2.contains("<group>b</group><name>a</name>"));
    }
   
    @Test
View Full Code Here

Examples of javax.xml.stream.XMLStreamWriter.writeEndDocument()

                XMLStreamWriter xtw = message.getContent(XMLStreamWriter.class);
                if (xtw != null) {
                    xtw.writeEndElement();           
                    // Write Envelope end element
                    xtw.writeEndElement();
                    xtw.writeEndDocument();
                   
                    xtw.flush();
                }
            } catch (XMLStreamException e) {
                SoapVersion soapVersion = message.getVersion();
View Full Code Here

Examples of javax.xml.stream.XMLStreamWriter.writeEndDocument()

            XMLStreamWriter spyingWriter = new PrefixCollectingXMLStreamWriter(w3cStreamWriter,
                                                                               namespaceMap);
            spyingWriter.writeStartDocument();
            // use type qname as element qname?
            aegisWriter.write(obj, aegisType.getSchemaType(), false, spyingWriter, aegisType);
            spyingWriter.writeEndDocument();
            spyingWriter.close();
            Document dom = w3cStreamWriter.getDocument();
            // ok, now the namespace map has all the prefixes.
           
            String enc = HttpUtils.getSetEncoding(m, headers, "UTF-8");
View Full Code Here

Examples of javax.xml.stream.XMLStreamWriter.writeEndDocument()

           
            XMLStreamWriter xmlStreamWriter = createStreamWriter(aegisType.getSchemaType(), enc, os);
            xmlStreamWriter.writeStartDocument();
            StaxUtils.copy(dom, xmlStreamWriter);
            // Jettison needs, and StaxUtils.copy doesn't do it.
            xmlStreamWriter.writeEndDocument();
            xmlStreamWriter.flush();
            xmlStreamWriter.close();
        } catch (Exception e) {
            throw ExceptionUtils.toInternalServerErrorException(e, null);
        }
View Full Code Here

Examples of javax.xml.stream.XMLStreamWriter.writeEndDocument()

            String enc = HttpUtils.getSetEncoding(m, headers, "UTF-8");
            XMLStreamWriter xmlStreamWriter = createStreamWriter(aegisType.getSchemaType(), enc, os);
            // use type qname as element qname?
            xmlStreamWriter.writeStartDocument();
            aegisWriter.write(obj, aegisType.getSchemaType(), false, xmlStreamWriter, aegisType);
            xmlStreamWriter.writeEndDocument();
            xmlStreamWriter.close();
        } catch (Exception e) {
            throw ExceptionUtils.toInternalServerErrorException(e, null);
        }
    }
View Full Code Here

Examples of javax.xml.stream.XMLStreamWriter.writeEndDocument()

      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

Examples of javax.xml.stream.XMLStreamWriter.writeEndDocument()

                StringWriter out = new StringWriter();
                XMLStreamWriter writer = factory.createXMLStreamWriter(out);
                writer.writeStartElement("root");
                writer.writeCharacters(text);
                writer.writeEndElement();
                writer.writeEndDocument();
                writer.flush();
                writer.close();
                assertEquals("<root>" + text + "</root>", out.toString());
            }
        });
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.