public MessageFactory getMessageFactory() { return soapVersion.getMessageFactory(); }
public MessageFactory getMessageFactory() { return soapVersion.getMessageFactory(); }
public MessageFactory getMessageFactory() { return soapVersion.getMessageFactory(); }
public SOAPMessage readAsSOAPMessageSax2Dom(final SOAPVersion soapVersion, final Message message) throws SOAPException { SOAPMessage msg = soapVersion.getMessageFactory().createMessage(); SAX2DOMEx s2d = new SAX2DOMEx(msg.getSOAPPart()); try { message.writeTo(s2d, XmlUtil.DRACONIAN_ERROR_HANDLER); } catch (SAXException e) { throw new SOAPException(e); } addAttachmentsToSOAPMessage(msg, message); if (msg.saveRequired()) msg.saveChanges(); return msg; }
public SOAPMessage readAsSOAPMessageSax2Dom(final SOAPVersion soapVersion, final Message message) throws SOAPException { SOAPMessage msg = soapVersion.getMessageFactory().createMessage(); SAX2DOMEx s2d = new SAX2DOMEx(msg.getSOAPPart()); try { message.writeTo(s2d, XmlUtil.DRACONIAN_ERROR_HANDLER); } catch (SAXException e) { throw new SOAPException(e); } addAttachmentsToSOAPMessage(msg, message); if (msg.saveRequired()) msg.saveChanges(); return msg; }
public SOAPMessage readAsSOAPMessageSax2Dom(final SOAPVersion soapVersion, final Message message) throws SOAPException { SOAPMessage msg = soapVersion.getMessageFactory().createMessage(); SAX2DOMEx s2d = new SAX2DOMEx(msg.getSOAPPart()); try { message.writeTo(s2d, XmlUtil.DRACONIAN_ERROR_HANDLER); } catch (SAXException e) { throw new SOAPException(e); } addAttachmentsToSOAPMessage(msg, message); if (msg.saveRequired()) msg.saveChanges(); return msg; }
public Source readEnvelopeAsSource() { try { if (!parsedMessage) { SOAPEnvelope se = sm.getSOAPPart().getEnvelope(); return new DOMSource(se); } else { SOAPMessage msg = soapVersion.getMessageFactory().createMessage(); addAttributes(msg.getSOAPPart().getEnvelope(),envelopeAttrs); SOAPBody newBody = msg.getSOAPPart().getEnvelope().getBody(); addAttributes(newBody, bodyAttrs); for (Element part : bodyParts) { Node n = newBody.getOwnerDocument().importNode(part, true); newBody.appendChild(n); } addAttributes(msg.getSOAPHeader(),headerAttrs); for (Header header : headers.asList()) { header.writeTo(msg); } SOAPEnvelope se = msg.getSOAPPart().getEnvelope(); return new DOMSource(se); } } catch (SOAPException e) { throw new WebServiceException(e); } }
public Source readEnvelopeAsSource() { try { if (!parsedMessage) { SOAPEnvelope se = sm.getSOAPPart().getEnvelope(); return new DOMSource(se); } else { SOAPMessage msg = soapVersion.getMessageFactory().createMessage(); addAttributes(msg.getSOAPPart().getEnvelope(),envelopeAttrs); SOAPBody newBody = msg.getSOAPPart().getEnvelope().getBody(); addAttributes(newBody, bodyAttrs); for (Element part : bodyParts) { Node n = newBody.getOwnerDocument().importNode(part, true); newBody.appendChild(n); } addAttributes(msg.getSOAPHeader(),headerAttrs); for (Header header : headers.asList()) { header.writeTo(msg); } SOAPEnvelope se = msg.getSOAPPart().getEnvelope(); return new DOMSource(se); } } catch (SOAPException e) { throw new WebServiceException(e); } }
public Source readEnvelopeAsSource() { try { if (!parsedMessage) { SOAPEnvelope se = sm.getSOAPPart().getEnvelope(); return new DOMSource(se); } else { SOAPMessage msg = soapVersion.getMessageFactory().createMessage(); addAttributes(msg.getSOAPPart().getEnvelope(),envelopeAttrs); SOAPBody newBody = msg.getSOAPPart().getEnvelope().getBody(); addAttributes(newBody, bodyAttrs); for (Element part : bodyParts) { Node n = newBody.getOwnerDocument().importNode(part, true); newBody.appendChild(n); } addAttributes(msg.getSOAPHeader(),headerAttrs); for (Header header : headers.asList()) { header.writeTo(msg); } SOAPEnvelope se = msg.getSOAPPart().getEnvelope(); return new DOMSource(se); } } catch (SOAPException e) { throw new WebServiceException(e); } }
/** * Reads Message as SOAPMessage. After this call message is consumed. * @param soapVersion SOAP version * @param message Message * @return Created SOAPMessage * @throws SOAPException if SAAJ processing fails */ public SOAPMessage readAsSOAPMessage(final SOAPVersion soapVersion, final Message message) throws SOAPException { SOAPMessage msg = soapVersion.getMessageFactory().createMessage(); SaajStaxWriter writer = new SaajStaxWriter(msg, soapVersion.nsUri); try { message.writeTo(writer); } catch (XMLStreamException e) { throw (e.getCause() instanceof SOAPException) ? (SOAPException) e.getCause() : new SOAPException(e); } msg = writer.getSOAPMessage(); addAttachmentsToSOAPMessage(msg, message); if (msg.saveRequired()) msg.saveChanges(); return msg; }
/** * Reads Message as SOAPMessage. After this call message is consumed. * @param soapVersion SOAP version * @param message Message * @return Created SOAPMessage * @throws SOAPException if SAAJ processing fails */ public SOAPMessage readAsSOAPMessage(final SOAPVersion soapVersion, final Message message) throws SOAPException { SOAPMessage msg = soapVersion.getMessageFactory().createMessage(); SaajStaxWriter writer = new SaajStaxWriter(msg, soapVersion.nsUri); try { message.writeTo(writer); } catch (XMLStreamException e) { throw (e.getCause() instanceof SOAPException) ? (SOAPException) e.getCause() : new SOAPException(e); } msg = writer.getSOAPMessage(); addAttachmentsToSOAPMessage(msg, message); if (msg.saveRequired()) msg.saveChanges(); return msg; }
/** * Reads Message as SOAPMessage. After this call message is consumed. * @param soapVersion SOAP version * @param message Message * @return Created SOAPMessage * @throws SOAPException if SAAJ processing fails */ public SOAPMessage readAsSOAPMessage(final SOAPVersion soapVersion, final Message message) throws SOAPException { SOAPMessage msg = soapVersion.getMessageFactory().createMessage(); SaajStaxWriter writer = new SaajStaxWriter(msg, soapVersion.nsUri); try { message.writeTo(writer); } catch (XMLStreamException e) { throw (e.getCause() instanceof SOAPException) ? (SOAPException) e.getCause() : new SOAPException(e); } msg = writer.getSOAPMessage(); addAttachmentsToSOAPMessage(msg, message); if (msg.saveRequired()) msg.saveChanges(); return msg; }
result = new SAAJMessage(readAsSOAPMessage()); } else { SOAPMessage msg = soapVersion.getMessageFactory().createMessage(); SOAPBody newBody = msg.getSOAPPart().getEnvelope().getBody(); for (Element part : bodyParts) {
result = new SAAJMessage(readAsSOAPMessage()); } else { SOAPMessage msg = soapVersion.getMessageFactory().createMessage(); SOAPBody newBody = msg.getSOAPPart().getEnvelope().getBody(); for (Element part : bodyParts) {
result = new SAAJMessage(readAsSOAPMessage()); } else { SOAPMessage msg = soapVersion.getMessageFactory().createMessage(); SOAPBody newBody = msg.getSOAPPart().getEnvelope().getBody(); for (Element part : bodyParts) {
public SOAPMessage readAsSOAPMessage() throws SOAPException { if (!parsedMessage) { return sm; } else { SOAPMessage msg = soapVersion.getMessageFactory().createMessage(); addAttributes(msg.getSOAPPart().getEnvelope(),envelopeAttrs); SOAPBody newBody = msg.getSOAPPart().getEnvelope().getBody(); addAttributes(newBody, bodyAttrs); for (Element part : bodyParts) { Node n = newBody.getOwnerDocument().importNode(part, true); newBody.appendChild(n); } addAttributes(msg.getSOAPHeader(),headerAttrs); for (Header header : headers.asList()) { header.writeTo(msg); } for (Attachment att : getAttachments()) { AttachmentPart part = msg.createAttachmentPart(); part.setDataHandler(att.asDataHandler()); part.setContentId('<' + att.getContentId() + '>'); addCustomMimeHeaders(att, part); msg.addAttachmentPart(part); } msg.saveChanges(); return msg; } }
public SOAPMessage readAsSOAPMessage() throws SOAPException { if (!parsedMessage) { return sm; } else { SOAPMessage msg = soapVersion.getMessageFactory().createMessage(); addAttributes(msg.getSOAPPart().getEnvelope(),envelopeAttrs); SOAPBody newBody = msg.getSOAPPart().getEnvelope().getBody(); addAttributes(newBody, bodyAttrs); for (Element part : bodyParts) { Node n = newBody.getOwnerDocument().importNode(part, true); newBody.appendChild(n); } addAttributes(msg.getSOAPHeader(),headerAttrs); for (Header header : headers.asList()) { header.writeTo(msg); } for (Attachment att : getAttachments()) { AttachmentPart part = msg.createAttachmentPart(); part.setDataHandler(att.asDataHandler()); part.setContentId('<' + att.getContentId() + '>'); addCustomMimeHeaders(att, part); msg.addAttachmentPart(part); } msg.saveChanges(); return msg; } }
public SOAPMessage readAsSOAPMessage() throws SOAPException { if (!parsedMessage) { return sm; } else { SOAPMessage msg = soapVersion.getMessageFactory().createMessage(); addAttributes(msg.getSOAPPart().getEnvelope(),envelopeAttrs); SOAPBody newBody = msg.getSOAPPart().getEnvelope().getBody(); addAttributes(newBody, bodyAttrs); for (Element part : bodyParts) { Node n = newBody.getOwnerDocument().importNode(part, true); newBody.appendChild(n); } addAttributes(msg.getSOAPHeader(),headerAttrs); for (Header header : headers.asList()) { header.writeTo(msg); } for (Attachment att : getAttachments()) { AttachmentPart part = msg.createAttachmentPart(); part.setDataHandler(att.asDataHandler()); part.setContentId('<' + att.getContentId() + '>'); addCustomMimeHeaders(att, part); msg.addAttachmentPart(part); } msg.saveChanges(); return msg; } }