Package org.apache.synapse.util.xpath

Examples of org.apache.synapse.util.xpath.SynapseXPath$ContextWrapper


        OMAttribute attSource = elem.getAttribute(ATT_SOURCE);
        OMAttribute attProperty = elem.getAttribute(ATT_PROPERTY);
       
        if (attSource != null) {
            try {
                mediator.setSource(new SynapseXPath(attSource));
            } catch (JaxenException e) {
                handleException("Invalid XPath specified for the source attribute : " +
                    attSource.getAttributeValue());
            }
        }
View Full Code Here


        log.addProperty(mp);

        mp = new MediatorProperty();
        mp.setName("ERROR_CODE");
        try {
            mp.setExpression(new SynapseXPath("get-property('ERROR_CODE')"));
        } catch (JaxenException ignore) {}
        log.addProperty(mp);

        mp = new MediatorProperty();
        mp.setName("ERROR_MESSAGE");
        try {
            mp.setExpression(new SynapseXPath("get-property('ERROR_MESSAGE')"));
        } catch (JaxenException ignore) {}
        log.addProperty(mp);

        fault.addChild(log);
        fault.addChild(new DropMediator());
View Full Code Here

                if (propName == null) {
                    handleException(
                        "A POJO command mediator property must specify the name attribute");
                } else {
                    if (child.getAttribute(ATT_EXPRN) != null) {
                        SynapseXPath xpath;
                        try {
                            xpath = SynapseXPathFactory.getSynapseXPath(child, ATT_EXPRN);
                            pojoMediator.addMessageSetterProperty(propName, xpath);
                        } catch (JaxenException e) {
                            handleException("Error instantiating XPath expression : " +
View Full Code Here

        OMAttribute valueAttr   = propElem.getAttribute(ATT_VALUE);
        OMAttribute exprAttr    = propElem.getAttribute(ATT_EXPRN);
        OMAttribute ctxNameAttr = propElem.getAttribute(ATT_CTXNAME);
        OMAttribute actionAttr  = propElem.getAttribute(ATT_ACTION);

        SynapseXPath xpath = null;
        try {
            if (exprAttr != null) {
                xpath = SynapseXPathFactory.getSynapseXPath(propElem, ATT_EXPRN);
            }
        } catch (JaxenException e) {
View Full Code Here

     * @return SynapseXpath
     */
    public SynapseXPath getExpression() {
        if(expression == null && keyValue != null && hasExprTypeKey()){
            try {
                expression = new SynapseXPath (keyValue.substring(1, keyValue.length()-1));
                for (OMNamespace aNamespaceList : namespaceList) {
                    expression.addNamespace(aNamespaceList);
                }
            } catch (JaxenException e) {
                expression = null;
View Full Code Here

    /** Lock object to provide the synchronized access to the activeAggregates on checking */
    private final Object lock = new Object();

    public AggregateMediator() {
        try {
            aggregationExpression = new SynapseXPath("s11:Body/child::*[position()=1] | " +
                "s12:Body/child::*[position()=1]");
            aggregationExpression.addNamespace("s11", SOAP11Constants.SOAP_ENVELOPE_NAMESPACE_URI);
            aggregationExpression.addNamespace("s12", SOAP12Constants.SOAP_ENVELOPE_NAMESPACE_URI);
        } catch (JaxenException e) {
            if (log.isDebugEnabled()) {
View Full Code Here

        } else if (attachPath != null) {
            attachPathValue = attachPath.getAttributeValue();
        }
       
        try {
            SynapseXPath xp = new SynapseXPath(attachPathValue);
            OMElementUtils.addNameSpaces(xp, elem, log);
            mediator.setAttachPath(xp);
        } catch (JaxenException e) {
            handleException("Unable to build the IterateMediator. Invalid XPATH " +
                attachPathValue, e);
View Full Code Here

        "<m0:CheckPriceRequest xmlns:m0=\"http://services.samples/xsd\">\n" +
        "<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;
    }
View Full Code Here

        String xsdKeyValue = null;

        String path;

        SynapseXPath xpath;

        // create a validate mediator
        ValidateMediator validate = new ValidateMediator();

        //default source, xsdFile, and state of key (dynamic or static)
        String source = "";
        String xsdFile = "";
        boolean isDynamicKey = true;

        // based on source, different xsdFiles can be used
        if (num == 0) {
            source = VALID_ENVELOPE;
            xsdKeyValue = "xsd-key";
            isDynamicKey = false;
            xsdFile = "validate";

        } else if (num == 1) {
            source = DYNAMIC_KEY_ENVELOPE;
            // xsdFile = "dynamic_key1.xsd";
            xsdKeyValue = "DynamicXsdKey";
            isDynamicKey = true;
            xsdFile = "validate3";
        }

        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

        // create a new XSLT mediator
        XSLTMediator 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
        setXsltTransformationURL(transformMediator, "xslt-key");
View Full Code Here

TOP

Related Classes of org.apache.synapse.util.xpath.SynapseXPath$ContextWrapper

Copyright © 2018 www.massapicom. 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.