Package org.apache.synapse.util.xpath

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


        OMElement pool = null;
        // get the 'pool' element and determine if we need to create a DataSource or
        // look up using JNDI
        try {
            SynapseXPath xpath = new SynapseXPath("self::node()/syn:connection/syn:pool");
            xpath.addNamespace("syn", XMLConfigConstants.SYNAPSE_NAMESPACE);
            pool = (OMElement) xpath.selectSingleNode(elem);

            if (pool.getFirstChildWithName(DRIVER_Q) != null) {
                createCustomDataSource(pool);
View Full Code Here


        }
        try {
            SynapseXPath synapseXPath = new SynapseXPath(xpath);
            for (OMNamespace omNamespace : omNameSpaces) {
                if (omNamespace != null) {
                    synapseXPath.addNamespace(omNamespace.getPrefix(), omNamespace.getNamespaceURI());
                }
            }
            return synapseXPath;
        } catch (JaxenException e) {
            throw new LoggedRuntimeException("Invalid XPapth expression : " +
View Full Code Here

        OMElement pool = null;
        // get the 'pool' element and determine if we need to create a DataSource or
        // look up using JNDI
        try {
            SynapseXPath xpath = new SynapseXPath("self::node()/syn:connection/syn:pool");
            xpath.addNamespace("syn", XMLConfigConstants.SYNAPSE_NAMESPACE);
            pool = (OMElement) xpath.selectSingleNode(elem);

            if (pool.getFirstChildWithName(DRIVER_Q) != null) {
                createCustomDataSource(pool);
View Full Code Here

        try {
            // get the 'pool' element and determine if we need to create a DataSource or
            // lookup using JNDI
            SynapseXPath xpath = new SynapseXPath("self::node()/syn:connection/syn:pool");
            xpath.addNamespace("syn", XMLConfigConstants.SYNAPSE_NAMESPACE);
            pool = (OMElement) xpath.selectSingleNode(elem);
            if (pool.getFirstChildWithName(DSNAME_Q) != null) {
                readLookupConfig(mediator, pool);
            } else if (pool.getFirstChildWithName(DRIVER_Q) != null) {
                readCustomDataSourceConfig(pool, mediator);
View Full Code Here

        "<m0:DynamicXsdKey>DynamicXsdKey</m0:DynamicXsdKey>\n" +
        "</m0:CheckPriceRequest>\n" ;

    private SynapseXPath createXPath(String expression) throws JaxenException {
        SynapseXPath xpath = new SynapseXPath(expression);
        xpath.addNamespace("m0", "http://services.samples/xsd");
        xpath.addNamespace("m1", "http://services.samples/xsd2");
        return xpath;
    }

    private void test(ValidateMediator validate, MessageContext synCtx, boolean expectFail) {
View Full Code Here

        "</m0:CheckPriceRequest>\n" ;

    private SynapseXPath createXPath(String expression) throws JaxenException {
        SynapseXPath xpath = new SynapseXPath(expression);
        xpath.addNamespace("m0", "http://services.samples/xsd");
        xpath.addNamespace("m1", "http://services.samples/xsd2");
        return xpath;
    }

    private void test(ValidateMediator validate, MessageContext synCtx, boolean expectFail) {
        final MutableInt onFailInvoked = new MutableInt();
View Full Code Here

        if (isDynamicKey) {
            // set the schema url using dynamic key (Xpath)
            path = "//m0:CheckPriceRequest/m0:" + xsdKeyValue;
            xpath = new SynapseXPath(path);
            xpath.addNamespace("m0", "http://services.samples/xsd");
            validate.setSchemaKeys(createKeyListFromDynamicKey(xpath));
        } else {
            // set the schema url using static key
            validate.setSchemaKeys(createKeyListFromStaticKey(xsdKeyValue));
        }
View Full Code Here

        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

        // create a new switch mediator
        transformMediator = new XSLTMediator();

        // set xpath condition to select source
        SynapseXPath xpath = new SynapseXPath("//m0:CheckPriceRequest");
        xpath.addNamespace("m0", "http://services.samples/xsd");
        transformMediator.setSource(xpath);

        // set XSLT transformation URL
        transformMediator.setXsltKey("xslt-key");
        List<MediatorProperty> list = new ArrayList<MediatorProperty>();
View Full Code Here

        // create a new switch mediator
        transformMediator = new XSLTMediator();

        // set xpath condition to select source
        SynapseXPath xpath = new SynapseXPath("//m0:CheckPriceRequest");
        xpath.addNamespace("m0", "http://services.samples/xsd");
        transformMediator.setSource(xpath);

        // set XSLT transformation URL
        transformMediator.setXsltKey("xslt-key");
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.