private void writeSwAMessage(OutputStream outputStream, OMOutputFormat format) throws XMLStreamException, UnsupportedEncodingException { StringWriter writer = new StringWriter(); SOAPEnvelope envelope = axiomMessage.getSOAPEnvelope(); if (payloadCaching) { envelope.serialize(writer, format); } else { envelope.serializeAndConsume(writer, format); } MIMEOutputUtils.writeSOAPWithAttachmentsMessage(writer, outputStream, attachments, format); }
private void writeSwAMessage(OutputStream outputStream, OMOutputFormat format) throws XMLStreamException, UnsupportedEncodingException { StringWriter writer = new StringWriter(); SOAPEnvelope envelope = axiomMessage.getSOAPEnvelope(); if (payloadCaching) { envelope.serialize(writer, format); } else { envelope.serializeAndConsume(writer, format); } try { OMMultipartWriter mpw = new OMMultipartWriter(outputStream, format); Writer rootPartWriter = new OutputStreamWriter(mpw.writeRootPart(), format.getCharSetEncoding()); rootPartWriter.write(writer.toString()); rootPartWriter.close(); // Get the collection of ids associated with the attachments for (String id: attachments.getAllContentIDs()) { mpw.writePart(attachments.getDataHandler(id), id); } mpw.complete(); } catch (IOException ex) { throw new OMException("Error writing SwA message", ex); } }
private void writeSwAMessage(OutputStream outputStream, OMOutputFormat format) throws XMLStreamException, UnsupportedEncodingException { StringWriter writer = new StringWriter(); SOAPEnvelope envelope = axiomMessage.getSOAPEnvelope(); if (payloadCaching) { envelope.serialize(writer, format); } else { envelope.serializeAndConsume(writer, format); } try { OMMultipartWriter mpw = new OMMultipartWriter(outputStream, format); Writer rootPartWriter = new OutputStreamWriter(mpw.writeRootPart(), format.getCharSetEncoding()); rootPartWriter.write(writer.toString()); rootPartWriter.close(); // Get the collection of ids associated with the attachments for (String id: attachments.getAllContentIDs()) { mpw.writePart(attachments.getDataHandler(id), id); } mpw.complete(); } catch (IOException ex) { throw new OMException("Error writing SwA message", ex); } }
private void writeSwAMessage(OutputStream outputStream, OMOutputFormat format) throws XMLStreamException, UnsupportedEncodingException { StringWriter writer = new StringWriter(); SOAPEnvelope envelope = axiomMessage.getSOAPEnvelope(); if (payloadCaching) { envelope.serialize(writer, format); } else { envelope.serializeAndConsume(writer, format); } try { OMMultipartWriter mpw = new OMMultipartWriter(outputStream, format); Writer rootPartWriter = new OutputStreamWriter(mpw.writeRootPart(), format.getCharSetEncoding()); rootPartWriter.write(writer.toString()); rootPartWriter.close(); // Get the collection of ids associated with the attachments for (String id: attachments.getAllContentIDs()) { mpw.writePart(attachments.getDataHandler(id), id); } mpw.complete(); } catch (IOException ex) { throw new OMException("Error writing SwA message", ex); } }