@Override protected void runTest() throws Throwable { SOAPBody body = newMessageFactory().createMessage().getSOAPBody(); SOAPElement child = body.addChildElement((SOAPElement)body.getOwnerDocument().createElementNS("urn:test", "p:test")); assertThat(child).isInstanceOf(SOAPBodyElement.class); } }
/** * Dumps the SOAPMessage to String * * @param msg the SOAP message * @return the String representation of the message * @throws IOException IO issue * @throws SOAPException SOAP issue */ public String dumpSoapMessage(SOAPMessage msg) throws IOException, SOAPException { Document doc = msg.getSOAPBody().getOwnerDocument(); OutputFormat format = new OutputFormat(doc); format.setLineWidth(65); format.setIndenting(true); format.setIndent(2); StringWriter s = new StringWriter(); XMLSerializer serializer = new XMLSerializer(s, format); serializer.serialize(doc); return s.toString(); }
if (!outbound && "inbound".equals(direction)) { Document doc = body.getOwnerDocument();
Element rpcOperationWrapper = body.getOwnerDocument().createElementNS(wrapperNamespace, msg.getOperation().getName()); for (Object arg : args) { Node next = (Node)arg; Node nextImported = body.getOwnerDocument().importNode(next, true); rpcOperationWrapper.appendChild(nextImported); Node msgNode = body.getOwnerDocument().importNode((Node)args[0], true); body.appendChild(msgNode);
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); } }
Node messageNodeImport = soapMessage.getSOAPBody().getOwnerDocument().importNode(messageNode, true); if (exchange.getState() != ExchangeState.FAULT || isSOAPFaultPayload(messageNode)) { if (_documentStyle) {
Node messageNodeImport = soapMessage.getSOAPBody().getOwnerDocument().importNode(messageNode, true); if (exchange.getState() != ExchangeState.FAULT || isSOAPFaultPayload(messageNode)) { if (_documentStyle) {
SOAPBody newBody = msg.getSOAPPart().getEnvelope().getBody(); for (Element part : bodyParts) { Node n = newBody.getOwnerDocument().importNode(part, true); newBody.appendChild(n);
SOAPBody newBody = msg.getSOAPPart().getEnvelope().getBody(); for (Element part : bodyParts) { Node n = newBody.getOwnerDocument().importNode(part, true); newBody.appendChild(n);
SOAPBody newBody = msg.getSOAPPart().getEnvelope().getBody(); for (Element part : bodyParts) { Node n = newBody.getOwnerDocument().importNode(part, true); newBody.appendChild(n);
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; } }