Package org.apache.axiom.om

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


            } 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

            }
            // 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

           * 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

                                .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

        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

            //otherwise serialize the OM by expanding the tree
        } else {
            try {
                ByteArrayOutputStream bytesOut = new ByteArrayOutputStream();
                XMLStreamWriter jsonWriter = getJSONWriter(bytesOut);
                element.serializeAndConsume(jsonWriter);
                jsonWriter.writeEndDocument();

                return bytesOut.toByteArray();

            } catch (XMLStreamException e) {
View Full Code Here

                {
                    jsonString = getStringToWrite(((OMSourcedElementImpl) dataOut).getDataSource());
                } else {
                    ByteArrayOutputStream out = new ByteArrayOutputStream();
                    XMLStreamWriter jsonWriter = getJSONWriter(out);
                    dataOut.serializeAndConsume(jsonWriter);
                    jsonWriter.writeEndDocument();
                    jsonString = new String(out.toByteArray());
                }
                jsonString = URIEncoderDecoder.quoteIllegal(jsonString, WSDL2Constants.LEGAL_CHARACTERS_IN_URL);
                String param = "query=" + jsonString;
View Full Code Here

        OMOutputFormat format = new OMOutputFormat();
        format.setDoOptimize(true);
        format.setSOAP11(true);
              
        ByteArrayOutputStream baos = new ByteArrayOutputStream();
        payload.serializeAndConsume(baos, format);

        TestLogger.logger.debug("==================================");
        TestLogger.logger.debug(baos.toString());
        TestLogger.logger.debug("==================================");
    }
View Full Code Here

            format.setSOAP11(msgContext.isSOAP11());
            format.setCharSetEncoding(
                    getProperty(msgContext, Constants.Configuration.CHARACTER_SET_ENCODING));
            format.setDoOptimize(msgContext.isDoingMTOM());
            try {
                msgElement.serializeAndConsume(baos, format);
                baos.flush();
            } catch (XMLStreamException e) {
                handleException("XML serialization error creating BytesMessage", e);
            } catch (IOException e) {
                handleException("IO Error while creating BytesMessage", e);
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.