Examples of serializeAndConsume()


Examples of org.apache.axiom.om.OMElement.serializeAndConsume()

        // Serialize and consume.  This should not cause expansion and currently won't update
        // the name of the element.
        StringWriter writer = new StringWriter();
        XMLStreamWriter xmlwriter = StAXUtils.createXMLStreamWriter(writer);
        root.serializeAndConsume(writer);
        xmlwriter.flush();
        String result = writer.toString();

        assertTrue(element.getLocalName().equals("DUMMYNAME"));
        assertTrue(element.getNamespace().getNamespaceURI().equals("http://DUMMYNS"));
View Full Code Here

Examples of org.apache.axiom.om.OMElement.serializeAndConsume()

                    if (omElement != null) {
                        try {
                            if (preserve) {
                                omElement.serialize(outputStream, format);
                            } else {
                                omElement.serializeAndConsume(outputStream, format);
                            }
                        } catch (XMLStreamException e) {
                            throw AxisFault.makeFault(e);
                        }
                    }
View Full Code Here

Examples of org.apache.axiom.om.OMElement.serializeAndConsume()

            } else if (BaseConstants.DEFAULT_TEXT_WRAPPER.equals(firstChild.getQName())) {
                try {
                    OutputStream os = responseFile.getContent().getOutputStream();

                    if (firstChild instanceof OMSourcedElementImpl) {
                        firstChild.serializeAndConsume(os);
                    } else {
                        os.write(firstChild.getText().getBytes());
                    }
                } catch (FileSystemException e) {
                    handleException("Error getting an output stream to file : " +
View Full Code Here

Examples of org.apache.axiom.om.OMElement.serializeAndConsume()

            }
            // create the new serices.xml file using the created xml infoset
            File newServicesXml = new File(servicesXmlPath);
            OMElement axisServiceGroupXMLInfoset = createServiceGroupXMLInfoset(axisServiceGroup);
            OutputStream os = new FileOutputStream(newServicesXml);
            axisServiceGroupXMLInfoset.serializeAndConsume(os);

            File[] oldWsdls = f.listFiles(new FileFilter() {
                public boolean accept(File fw) {
                    return fw.getName().endsWith(".wsdl");
                }
View Full Code Here

Examples of org.apache.axiom.om.OMElement.serializeAndConsume()

           * getXMLStreamReader() method will execute the actual request */
          if (i == (n - 1)) {
            return DBUtils.cloneAndReturnBuiltElement(result);
          } else {
              /* process the result of the request, no need to cache the data */
              result.serializeAndConsume(new NullOutputStream());
          }
        } catch (XMLStreamException e) {
          throw new DataServiceFault(e, "Error in request box result serializing");
        }
      }
View Full Code Here

Examples of org.apache.axiom.om.OMElement.serializeAndConsume()

                                .getProperty(Constants.Configuration.CHARACTER_SET_ENCODING);

                format.setDoOptimize(false);
                format.setDoingSWA(false);
                format.setCharSetEncoding(charSetEnc);
                outputMessage.serializeAndConsume(out, format);
                out.flush();
            } catch (Exception e) {
                throw AxisFault.makeFault(e);
            }
        } else {
View Full Code Here

Examples of org.apache.axiom.om.OMElement.serializeAndConsume()

        element.setNamespace(ns);
        element.setLocalName("dummy");
        // TODO: See https://issues.apache.org/jira/browse/WSCOMMONS-226
        // element.getBuilder().setCache(true);
        StringWriter writer = new StringWriter();
        element.serializeAndConsume(writer);
        // System.out.println(writer);
    }

}
View Full Code Here

Examples of org.apache.axiom.om.OMNode.serializeAndConsume()

        Iterator it = omDocument.getChildren();
        while (it.hasNext()) {
            OMNode omNode = (OMNode) it.next();
            // TODO: quick fix required because OMChildrenIterator#next() no longer builds the node
            omNode.getNextOMSibling();
            omNode.serializeAndConsume(xmlwriter);
        }
        xmlwriter.flush();
        String result = writer.toString();
        // We can't test for equivalence because the underlying OMSourceElement is
        // changed as it is serialized.  So I am testing for an internal value.
View Full Code Here

Examples of org.apache.axiom.om.OMNode.serializeAndConsume()

        try {
            OMDocument omDocument = builder.getDocument();
            Iterator it = omDocument.getChildren();
            while (it.hasNext()) {
                OMNode omNode = (OMNode) it.next();
                omNode.serializeAndConsume(writer);
            }
        } finally {
            builder.close();
        }
    }
View Full Code Here

Examples of org.apache.axiom.om.OMNode.serializeAndConsume()

        Iterator it = omDocument.getChildren();
        while (it.hasNext()) {
            OMNode omNode = (OMNode) it.next();
            // TODO: quick fix required because OMChildrenIterator#next() no longer builds the node
            omNode.getNextOMSibling();
            omNode.serializeAndConsume(xmlwriter);
        }

        xmlwriter.flush();
        String result = writer.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.