Package org.apache.synapse.util.xpath

Examples of org.apache.synapse.util.xpath.SynapseXPath.addNamespace()


        OMElement response = businessClient.sendReceive(commodityPayload());

        assertNotNull(response);

        SynapseXPath xPath = new SynapseXPath("//return");
        xPath.addNamespace("ns","http://services.samples/xsd");
        OMElement returnEle = (OMElement) xPath.selectSingleNode(response);

        assertNotNull(returnEle);

        assertEquals(returnEle.getText().trim(),"100");
View Full Code Here


                                "</ns1:a>";


    public void testMessageContextGetStringValueBody() throws Exception {
        SynapseXPath axiomXpath = new SynapseXPath("$body/ns1:a/ns1:c");
        axiomXpath.addNamespace("ns1", nsNamespace1);
        MessageContext synCtx = TestUtils.getTestContext(sampleBody);

        String result = axiomXpath.stringValueOf(synCtx);
        assertEquals("second", result);
    }
View Full Code Here

        assertEquals("second", result);
    }

    public void testMessageContextGetStringValueEnvelope() throws Exception {
        SynapseXPath axiomXpath = new SynapseXPath("/s11:Envelope/s11:Body/ns1:a/ns1:c");
        axiomXpath.addNamespace("s11", nsSoapEnv);
        axiomXpath.addNamespace("ns1", nsNamespace1);

        MessageContext synCtx = TestUtils.getTestContext(sampleBody);

        String result = axiomXpath.stringValueOf(synCtx);
View Full Code Here

    }

    public void testMessageContextGetStringValueEnvelope() throws Exception {
        SynapseXPath axiomXpath = new SynapseXPath("/s11:Envelope/s11:Body/ns1:a/ns1:c");
        axiomXpath.addNamespace("s11", nsSoapEnv);
        axiomXpath.addNamespace("ns1", nsNamespace1);

        MessageContext synCtx = TestUtils.getTestContext(sampleBody);

        String result = axiomXpath.stringValueOf(synCtx);
        assertEquals("second", result);
View Full Code Here

        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());
    }
View Full Code Here

        // create a new filter mediator
        FilterMediator filter = new FilterMediator();

        // set xpath condition to IBM
        SynapseXPath xpath = new SynapseXPath("//*[wsx:symbol='IBM']");
        xpath.addNamespace("wsx", "http://www.webserviceX.NET/");
        filter.setXpath(xpath);

        // set dummy mediator to be called on success
        filter.addChild(testMediator);

View Full Code Here

        // create a new filter mediator
        FilterMediator filter = new FilterMediator();

        // set xpath condition to MSFT
        SynapseXPath xpath = new SynapseXPath("//*[wsx:symbol='MSFT']");
        xpath.addNamespace("wsx", "http://www.webserviceX.NET/");
        filter.setXpath(xpath);

        // set dummy mediator to be called on success
        filter.addChild(testMediator);

View Full Code Here

        // create a new filter mediator
        FilterMediator filter = new FilterMediator();

        // set source xpath condition to //symbol
        SynapseXPath source = new SynapseXPath("//wsx:symbol");
        source.addNamespace("wsx", "http://www.webserviceX.NET/");
        filter.setSource(source);

        // set regex to IBM
        Pattern regex = Pattern.compile("IBM");
        filter.setRegex(regex);
View Full Code Here

        // create a new filter mediator
        FilterMediator filter = new FilterMediator();

        // set source xpath condition to //symbol
        SynapseXPath source = new SynapseXPath("//wsx:symbol");
        source.addNamespace("wsx", "http://www.webserviceX.NET/");
        filter.setSource(source);

        // set regex to MSFT
        Pattern regex = Pattern.compile("MSFT");
        filter.setRegex(regex);
View Full Code Here

        // create a new filter mediator
        FilterMediator filter = new FilterMediator();

        // set source xpath condition to //symbol
        SynapseXPath source = new SynapseXPath("//wsx:symbol");
        source.addNamespace("wsx", "http://www.webserviceX.NET/");
        filter.setSource(source);

        // set regex to MSFT
        Pattern regex = Pattern.compile("MSFT");
        filter.setRegex(regex);
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.