public void setIgnoreXMLDeclaration(boolean ignoreXMLDeclaration) { format.setIgnoreXMLDeclaration(ignoreXMLDeclaration); }
public String encode(ClientOptions options, XMLMessage message) throws Exception { if (message.getType() == XMLMessage.Type.SWA) { throw new UnsupportedOperationException(); } OMOutputFormat format = new OMOutputFormat(); format.setIgnoreXMLDeclaration(true); StringWriter sw = new StringWriter(); message.getMessageElement().serializeAndConsume(sw, format); return sw.toString(); } };
public String encode(ClientOptions options, XMLMessage message) throws Exception { if (message.getType() == XMLMessage.Type.SWA) { throw new UnsupportedOperationException(); } OMOutputFormat format = new OMOutputFormat(); format.setIgnoreXMLDeclaration(true); StringWriter sw = new StringWriter(); message.getMessageElement().serializeAndConsume(sw, format); return sw.toString(); } };
public String encode(ClientOptions options, XMLMessage message) throws Exception { if (message.getType() == XMLMessage.Type.SWA) { throw new UnsupportedOperationException(); } OMOutputFormat format = new OMOutputFormat(); format.setIgnoreXMLDeclaration(true); StringWriter sw = new StringWriter(); message.getMessageElement().serializeAndConsume(sw, format); return sw.toString(); } };
/** * Writes the om to a log.debug. * This method assumes optimized mtom attachments * Also calculates the length of the message. * @param om OMElement * @param log Log * @param limit limit of message to write * @return length of entire message */ public static long logDebug(OMElement om, Log log, int limit) { OMOutputFormat format = new OMOutputFormat(); format.setDoOptimize(true); format.setIgnoreXMLDeclaration(true); return logDebug(om, log, limit, format); }
public byte[] encode(ClientOptions options, XMLMessage message) throws Exception { ByteArrayOutputStream baos = new ByteArrayOutputStream(); OMOutputFormat outputFormat = new OMOutputFormat(); outputFormat.setCharSetEncoding(options.getCharset()); outputFormat.setIgnoreXMLDeclaration(true); if (message.getType() == XMLMessage.Type.SWA) { outputFormat.setMimeBoundary(options.getMimeBoundary()); outputFormat.setRootContentId(options.getRootContentId()); StringWriter writer = new StringWriter(); message.getMessageElement().serializeAndConsume(writer); MIMEOutputUtils.writeSOAPWithAttachmentsMessage(writer, baos, message.getAttachments(), outputFormat); } else { message.getMessageElement().serializeAndConsume(baos, outputFormat); } return baos.toByteArray(); } };
public byte[] encode(ClientOptions options, XMLMessage message) throws Exception { ByteArrayOutputStream baos = new ByteArrayOutputStream(); OMOutputFormat outputFormat = new OMOutputFormat(); outputFormat.setCharSetEncoding(options.getCharset()); outputFormat.setIgnoreXMLDeclaration(true); if (message.getType() == XMLMessage.Type.SWA) { outputFormat.setMimeBoundary(options.getMimeBoundary()); outputFormat.setRootContentId(options.getRootContentId()); OMMultipartWriter mpw = new OMMultipartWriter(baos, outputFormat); OutputStream out = mpw.writeRootPart(); message.getMessageElement().serializeAndConsume(out); out.close(); Attachments attachments = message.getAttachments(); for (String id : attachments.getAllContentIDs()) { mpw.writePart(attachments.getDataHandler(id), id); } mpw.complete(); } else { message.getMessageElement().serializeAndConsume(baos, outputFormat); } return baos.toByteArray(); } };
public byte[] encode(ClientOptions options, XMLMessage message) throws Exception { ByteArrayOutputStream baos = new ByteArrayOutputStream(); OMOutputFormat outputFormat = new OMOutputFormat(); outputFormat.setCharSetEncoding(options.getCharset()); outputFormat.setIgnoreXMLDeclaration(true); if (message.getType() == XMLMessage.Type.SWA) { outputFormat.setMimeBoundary(options.getMimeBoundary()); outputFormat.setRootContentId(options.getRootContentId()); OMMultipartWriter mpw = new OMMultipartWriter(baos, outputFormat); OutputStream out = mpw.writeRootPart(); message.getMessageElement().serializeAndConsume(out); out.close(); Attachments attachments = message.getAttachments(); for (String id : attachments.getAllContentIDs()) { mpw.writePart(attachments.getDataHandler(id), id); } mpw.complete(); } else { message.getMessageElement().serializeAndConsume(baos, outputFormat); } return baos.toByteArray(); } };
if (writeXmlDecl == null || writeXmlDecl.equals("false")) { format.setIgnoreXMLDeclaration(true);
if (writeXmlDecl == null || writeXmlDecl.equals("false")) { format.setIgnoreXMLDeclaration(true);