Examples of SOAPFactory


Examples of org.apache.axiom.soap.SOAPFactory

                                    synapseOutMessageContext, outboundWsSecPolicyKey));
                }
            }
            // temporary workaround for https://issues.apache.org/jira/browse/WSCOMMONS-197
            if (axisOutMsgCtx.getEnvelope().getHeader() == null) {
                SOAPFactory fac = axisOutMsgCtx.isSOAP11() ?
                        OMAbstractFactory.getSOAP11Factory() : OMAbstractFactory.getSOAP12Factory();
                fac.createSOAPHeader(axisOutMsgCtx.getEnvelope());
            }
        }

        OperationClient mepClient = axisAnonymousOperation.createClient(serviceCtx, clientOptions);
        mepClient.addMessageContext(axisOutMsgCtx);
View Full Code Here

Examples of org.apache.axiom.soap.SOAPFactory

            }

            // temporary workaround for https://issues.apache.org/jira/browse/WSCOMMONS-197
            if (messageContext.isEngaged(SynapseConstants.SECURITY_MODULE_NAME) &&
                messageContext.getEnvelope().getHeader() == null) {
                SOAPFactory fac = messageContext.isSOAP11() ?
                    OMAbstractFactory.getSOAP11Factory() : OMAbstractFactory.getSOAP12Factory();
                fac.createSOAPHeader(messageContext.getEnvelope());
            }

            Axis2FlexibleMEPClient.clearSecurtityProperties(messageContext.getOptions());

           // report stats for any component at response sending check point
View Full Code Here

Examples of org.apache.axiom.soap.SOAPFactory

     * @param content the XML for the new header
     * @throws ScriptException if an error occurs when converting the XML to OM
     */
    public void addHeader(boolean mustUnderstand, Object content) throws ScriptException {
        SOAPEnvelope envelope = mc.getEnvelope();
        SOAPFactory factory = (SOAPFactory)envelope.getOMFactory();
        SOAPHeader header = envelope.getHeader();
        if (header == null) {
            header = factory.createSOAPHeader(envelope);
        }
        OMElement element = xmlHelper.toOMElement(content);
        // We can't add the element directly to the SOAPHeader. Instead, we need to copy the
        // information over to a SOAPHeaderBlock.
        SOAPHeaderBlock headerBlock = header.addHeaderBlock(element.getLocalName(),
View Full Code Here

Examples of org.apache.axiom.soap.SOAPFactory

    }
   
    public void addSoapFaultToMessageContext(MessageContext msgContext, String faultCode,
            String faultReason, String faultDetail) throws AxisFault {
       
        SOAPFactory factory = OMAbstractFactory.getSOAP11Factory();
        SOAPEnvelope faultEnvelope = factory.getDefaultFaultEnvelope();      
        SOAPFault soapFault = faultEnvelope.getBody().getFault();

        SOAPFaultCode soapFaultCode = factory.createSOAPFaultCode();
        soapFaultCode.setText(faultCode);
        soapFault.setCode(soapFaultCode);
       
        SOAPFaultReason soapFaultReason = factory.createSOAPFaultReason();
        soapFaultReason.setText(faultReason);
        soapFault.setReason(soapFaultReason);
       
        SOAPFaultDetail soapFaultDetail = factory.createSOAPFaultDetail();
        soapFaultDetail.setText(faultDetail);
        soapFault.setDetail(soapFaultDetail);
       
        msgContext.setEnvelope(faultEnvelope);
    }
View Full Code Here

Examples of org.apache.axiom.soap.SOAPFactory

                                    synapseOutMessageContext, outboundWsSecPolicyKey));
                }
            }
            // temporary workaround for https://issues.apache.org/jira/browse/WSCOMMONS-197
            if (axisOutMsgCtx.getEnvelope().getHeader() == null) {
                SOAPFactory fac = axisOutMsgCtx.isSOAP11() ?
                        OMAbstractFactory.getSOAP11Factory() : OMAbstractFactory.getSOAP12Factory();
                fac.createSOAPHeader(axisOutMsgCtx.getEnvelope());
            }
        }

        OperationClient mepClient = axisAnonymousOperation.createClient(serviceCtx, clientOptions);
        mepClient.addMessageContext(axisOutMsgCtx);
View Full Code Here

Examples of org.apache.axiom.soap.SOAPFactory

        txtRtvr = new PropertyTextRetriever("bogusKey");
        assertNull(txtRtvr.getSourceText(context));
    }

    public void testSOAPEnvelopeTextRetriever() throws Exception {
        SOAPFactory fac = OMAbstractFactory.getSOAP11Factory();
        SOAPEnvelope env = fac.getDefaultEnvelope();

        OMElement payload = AXIOMUtil.stringToOM(fac,
                "<getQuote id=\"attr\"><symbol>TEST</symbol><property>1</property>" +
                        "<property>2</property></getQuote>");
        env.getBody().addChild(payload);
View Full Code Here

Examples of org.apache.axiom.soap.SOAPFactory

    private void addCustomHeader(MessageContext synCtx, String value) {
        SOAPEnvelope env = synCtx.getEnvelope();
        if (env == null) {
            return;
        }
        SOAPFactory fac = (SOAPFactory) env.getOMFactory();
        SOAPHeader header = env.getHeader();
        if (header == null) {
            header = fac.createSOAPHeader(env);
        }
        SOAPHeaderBlock hb = header.addHeaderBlock(qName.getLocalPart(),
                fac.createOMNamespace(qName.getNamespaceURI(), qName.getPrefix()));
        hb.setText(value);
    }
View Full Code Here

Examples of org.apache.axiom.soap.SOAPFactory

    }

    public void runTest(String value, String expected)
            throws XMLStreamException, FactoryConfigurationError, IOException {

        SOAPFactory factory = OMAbstractFactory.getSOAP12Factory();
        SOAPEnvelope envelope = factory.getDefaultEnvelope();
        String ns = "http://testuri.org";
        OMNamespace namespace = factory.createOMNamespace(ns, "tst");

        String ln = "Child";

        OMElement bodyChild = factory.createOMElement(ln, namespace);
        bodyChild.addChild(factory.createOMText(value));

        envelope.getBody().addChild(bodyChild);


        ByteArrayOutputStream byteOutStr = new ByteArrayOutputStream();
View Full Code Here

Examples of org.apache.axiom.soap.SOAPFactory

    }

    protected void runTest() throws Throwable {
        // Prepare the message. Note that we do this programmatically to make sure that the message
        // doesn't contain any unwanted whitespace.
        SOAPFactory factory = spec.getFactory(metaFactory);
        SOAPEnvelope orgEnvelope = factory.getDefaultEnvelope();
        orgEnvelope.getBody().addChild(soapFactory.createOMElement(qname.getLocalPart(), qname.getNamespaceURI(), qname.getPrefix()));
        String message = orgEnvelope.toString();
       
        SOAPEnvelope envelope = OMXMLBuilderFactory.createSOAPModelBuilder(metaFactory, new StringReader(message)).getSOAPEnvelope();
        assertEquals(qname.getLocalPart(), envelope.getSOAPBodyFirstElementLocalName());
View Full Code Here

Examples of org.apache.axiom.soap.SOAPFactory

    }

    public void submitPurchaseOrderTest()
            throws Exception {
        SOAPFactory omFactory = OMAbstractFactory.getSOAP11Factory();
        SOAPEnvelope env = omFactory.getDefaultEnvelope();
        OMXMLParserWrapper builder = OMXMLBuilderFactory.createOMBuilder(
                omFactory, new InputStreamReader(
                                new ByteArrayInputStream(xmlText2.getBytes())));
        env.getBody().addChild(builder.getDocumentElement());
View Full Code Here
TOP
Copyright © 2018 www.massapi.com. All rights reserved.
All source code are property of their respective owners. Java is a trademark of Sun Microsystems, Inc and owned by ORACLE Inc. Contact coftware#gmail.com.