Examples of writeStartElement()


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

        m.setContent(Exception.class, fault);

        ByteArrayOutputStream out = new ByteArrayOutputStream();
        XMLStreamWriter writer = StaxUtils.createXMLStreamWriter(out);
        writer.writeStartDocument();
        writer.writeStartElement("Body");

        m.setContent(XMLStreamWriter.class, writer);

        Soap12FaultOutInterceptorInternal.INSTANCE.handleMessage(m);
View Full Code Here

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

    public static void marshallException(Marshaller marshaller, Exception elValue,
                                         MessagePartInfo part, Object source) {
        XMLStreamWriter writer = getStreamWriter(source);
        QName qn = part.getElementQName();
        try {
            writer.writeStartElement("ns1", qn.getLocalPart(), qn.getNamespaceURI());
            Class<?> cls = part.getTypeClass();
            XmlAccessType accessType = Utils.getXmlAccessType(cls);
            String namespace = part.getElementQName().getNamespaceURI();
            String attNs = namespace;
           
View Full Code Here

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

                    if (soapVersion.getNamespace().equals(entry.getValue())) {
                        soapPrefix = entry.getKey();
                    }
                }
                xtw.setPrefix(soapPrefix, soapVersion.getNamespace());
                xtw.writeStartElement(soapPrefix,
                                      soapVersion.getEnvelope().getLocalPart(),
                                      soapVersion.getNamespace());
                xtw.writeNamespace(soapPrefix, soapVersion.getNamespace());
                for (Map.Entry<String, String> entry : nsMap.entrySet()) {
                    if (!soapVersion.getNamespace().equals(entry.getValue())) {
View Full Code Here

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

                        xtw.writeNamespace(entry.getKey(), entry.getValue());
                    }
                }               
            } else {
                xtw.setPrefix(soapPrefix, soapVersion.getNamespace());
                xtw.writeStartElement(soapPrefix,
                                      soapVersion.getEnvelope().getLocalPart(),
                                      soapVersion.getNamespace());
                String s2 = xtw.getPrefix(soapVersion.getNamespace());
                if (StringUtils.isEmpty(s2) || soapPrefix.equals(s2)) {
                    xtw.writeNamespace(soapPrefix, soapVersion.getNamespace());
View Full Code Here

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

                }
            }
            boolean preexistingHeaders = message.hasHeaders();

            if (preexistingHeaders) {
                xtw.writeStartElement(soapPrefix,
                                      soapVersion.getHeader().getLocalPart(),
                                      soapVersion.getNamespace());  
                List<Header> hdrList = message.getHeaders();
                for (Header header : hdrList) {
                    XMLStreamWriter writer = xtw;
View Full Code Here

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

                    continue;
                }
                objs.remove(part);
                if (!(startedHeader || preexistingHeaders)) {
                    try {
                        xtw.writeStartElement(soapPrefix,
                                              soapVersion.getHeader().getLocalPart(),
                                              soapVersion.getNamespace());
                    } catch (XMLStreamException e) {
                        throw new SoapFault(new org.apache.cxf.common.i18n.Message("XML_WRITE_EXC", BUNDLE),
                            e, soapVersion.getSender());
View Full Code Here

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

        ConcurrentTestUtils.testThreadSafety(new Action() {
            public void execute() throws Exception {
                String text = String.valueOf((int)(Math.random() * 10000));
                StringWriter out = new StringWriter();
                XMLStreamWriter writer = factory.createXMLStreamWriter(out);
                writer.writeStartElement("root");
                writer.writeCharacters(text);
                writer.writeEndElement();
                writer.writeEndDocument();
                writer.flush();
                writer.close();
View Full Code Here

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

   
    try {
      writer = outputFactory.createXMLStreamWriter(output);
      writer.writeStartDocument("1.0");
     
      writer.writeStartElement(objectType + "s");

      for (HtmlRow row : table.getBodyRows()) {
        writer.writeStartElement(objectType);

        int i = 0;
View Full Code Here

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

      writer.writeStartDocument("1.0");
     
      writer.writeStartElement(objectType + "s");

      for (HtmlRow row : table.getBodyRows()) {
        writer.writeStartElement(objectType);

        int i = 0;
        for (HtmlColumn column : row.getColumns(ReservedFormat.ALL, ReservedFormat.XML)) {
          writer.writeAttribute(headers.get(i), column.getContent().toString());
          i++;
View Full Code Here

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

        XMLOutputFactory outputFactory = XMLOutputFactory.newFactory();
        try {
            XMLStreamWriter stream = outputFactory.createXMLStreamWriter(response.getWriter());
            stream.writeStartDocument("1.0");

            stream.writeStartElement("", "urlset", NS);
            stream.writeNamespace("", NS);

            // first do the current page
            write(page, stream, resourceResolver);
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.