public ResponseMessageBuilder(MessageContext messageCtx) { factory = (SOAPFactory) messageCtx.getEnvelope().getOMFactory(); }
public GetStatusCommandBuilder(MessageContext messageCtx) { factory = (SOAPFactory) messageCtx.getEnvelope().getOMFactory(); }
public SOAPBody createSOAPBody(SOAPEnvelope envelope) throws SOAPProcessingException { return new SOAP11BodyImpl(envelope, (SOAPFactory) envelope .getOMFactory()); }
public SOAPBody createSOAPBody(SOAPEnvelope envelope, OMXMLParserWrapper builder) { return new SOAP11BodyImpl(envelope, builder, (SOAPFactory) envelope .getOMFactory()); }
public static void setBinaryPayload(SOAPEnvelope envelope, DataHandler dh) { OMFactory fac = envelope.getOMFactory(); OMElement binaryElt = envelope.getOMFactory() .createOMElement(BINARYELT); OMText text = fac.createOMText(dh, true); binaryElt.addChild(text); setXMLPayload(envelope, binaryElt); }
public static void setTextPayload(SOAPEnvelope envelope, String text) { OMFactory fac = envelope.getOMFactory(); OMElement textElt = envelope.getOMFactory().createOMElement(TEXTELT); OMText textNode = fac.createOMText(text); textElt.addChild(textNode); setXMLPayload(envelope, textElt); }
public static void setBinaryPayload(SOAPEnvelope envelope, DataHandler dh) { OMFactory fac = envelope.getOMFactory(); OMElement binaryElt = envelope.getOMFactory() .createOMElement(BINARYELT); OMText text = fac.createOMText(dh, true); binaryElt.addChild(text); setXMLPayload(envelope, binaryElt); }
public static void setTextPayload(SOAPEnvelope envelope, String text) { OMFactory fac = envelope.getOMFactory(); OMElement textElt = envelope.getOMFactory().createOMElement(TEXTELT); OMText textNode = fac.createOMText(text); textElt.addChild(textNode); setXMLPayload(envelope, textElt); }
public SOAPElement addTextNode(String text) throws SOAPException { Node firstChild = target.getFirstChild(); if (firstChild instanceof org.w3c.dom.Text) { ((org.w3c.dom.Text)firstChild).setData(text); } else { // Else this is a header ((OMNode)firstChild).insertSiblingBefore(this.omTarget.getOMFactory().createOMText(text)); } return this; }
public static void setMapPayload(SOAPEnvelope envelope, SimpleMap map) { if (map instanceof SimpleMapImpl) { SimpleMapImpl impl = (SimpleMapImpl) map; OMElement mapElt = impl.getOMElement(envelope.getOMFactory()); if (mapElt == null) { log.debug("null map element returned"); return; } setXMLPayload(envelope, mapElt); } else { throw new SynapseException("cannot handle any other instance of SimpleMap at this point TODO"); } }
public SOAPElement addTextNode(String text) throws SOAPException { Node firstChild = target.getFirstChild(); if (firstChild instanceof org.w3c.dom.Text) { ((org.w3c.dom.Text)firstChild).setData(text); } else { // Else this is a header ((OMNode)firstChild).insertSiblingBefore(this.omTarget.getOMFactory().createOMText(text)); } return this; }
public static void setStAXPayload(SOAPEnvelope envelope, XMLStreamReader streamReader) { OMXMLParserWrapper builder = OMXMLBuilderFactory.createStAXOMBuilder(envelope.getOMFactory(), streamReader); OMElement el = builder.getDocumentElement(); setXMLPayload(envelope, el); }
private void populateSOAPBody(SOAPEnvelope soapEnvelope, PartnerRoleMessageExchange partnerRoleMessageExchange) { org.apache.ode.bpel.iapi.Message messageToSend = partnerRoleMessageExchange.getRequest(); if (messageToSend.getParts().size() == 1) { soapEnvelope.getBody().addChild(OMUtils.toOM( getPartContent(messageToSend.getPart(messageToSend.getParts().get(0))), soapEnvelope.getOMFactory())); } else { throw new IllegalArgumentException("HTTP Binding doesn't support multiple message part as the input."); } }
public static void setStAXPayload(SOAPEnvelope envelope, XMLStreamReader streamReader) { StAXOMBuilder builder = new StAXOMBuilder(envelope.getOMFactory(), streamReader); OMElement el = builder.getDocumentElement(); setXMLPayload(envelope, el); }
/** * Override SOAPElement.addChildElement SOAP 1.2 should not allow element to be added after body * element */ public SOAPElement addChildElement(Name name) throws SOAPException { if (((SOAPFactory)this.omTarget.getOMFactory()).getSOAPVersion() == SOAP12Version.getSingleton()) { throw new SOAPException("Cannot add elements after body element"); } else if (((SOAPFactory)this.omTarget.getOMFactory()).getSOAPVersion() == SOAP11Version.getSingleton()) { //Let elements to be added any where. return super.addChildElement(name); } return null; }
public static void addSOAPHeaderBlock(org.apache.axis2.context.MessageContext msgCtx, QName qname, String value) { SOAPEnvelope env = msgCtx.getEnvelope(); SOAPHeaderBlock header = env.getHeader().addHeaderBlock( qname.getLocalPart(), msgCtx.getEnvelope().getOMFactory(). createOMNamespace(qname.getNamespaceURI(), qname.getPrefix())); header.setText(value); }
public static void setXMLPayload(SOAPEnvelope envelope, OMElement element) { SOAPBody body = envelope.getBody(); if (body == null) { body = ((SOAPFactory)envelope.getOMFactory()).createSOAPBody(); if (envelope.getHeader() != null) { envelope.getHeader().insertSiblingAfter(body); } else { envelope.addChild(body); } } else { body.removeChildren(); } body.addChild(element); }
public SOAPMessageImpl(SOAPEnvelopeImpl soapEnvelope) { this.mimeHeaders = new MimeHeaders(); this.mimeHeaders.addHeader("content-type", ((SOAPFactory)soapEnvelope.omTarget.getOMFactory()).getSOAPVersion().getMediaType().toString()); soapPart = new SOAPPartImpl(this, soapEnvelope); }
public SOAPMessageImpl(SOAPEnvelopeImpl soapEnvelope) { this.mimeHeaders = new MimeHeaders(); this.mimeHeaders.addHeader("content-type", ((SOAPFactory)soapEnvelope.omTarget.getOMFactory()).getSOAPVersion().getMediaType().toString()); soapPart = new SOAPPartImpl(this, soapEnvelope); }
public void testHeaderRelativeXPath() throws Exception { MessageContext ctx = TestUtils.getTestContext("<test>" + message + "</test>"); OMFactory fac = ctx.getEnvelope().getOMFactory(); OMNamespace ns = fac.createOMNamespace("http://test", "t"); ctx.getEnvelope().getHeader().addHeaderBlock("test", ns).setText(message); ctx.getEnvelope().getHeader().addHeaderBlock("test2", ns); SynapseXPath xpath = new SynapseXPath("$header/t:test"); xpath.addNamespace(ns); assertEquals(message, xpath.stringValueOf(ctx)); xpath = new SynapseXPath("$header/*"); assertEquals(2, xpath.selectNodes(ctx).size()); }