Package org.apache.cxf.helpers

Examples of org.apache.cxf.helpers.MapNamespaceContext


                Map<String, String> namespaces = rp.getDeclaredNamespaces();
                XPathFactory factory = XPathFactory.newInstance();
                for (String expression : rp.getXPathExpressions()) {
                    XPath xpath = factory.newXPath();
                    if (namespaces != null) {
                        xpath.setNamespaceContext(new MapNamespaceContext(namespaces));
                    }
                    NodeList list;
                    try {
                        list = (NodeList)xpath.evaluate(expression,
                                                                 header,
View Full Code Here


        // each request.
        final XPathFactory factory = XPathFactory.newInstance();
        final XPath xpath = factory.newXPath();
       
        if (namespaces != null) {
            xpath.setNamespaceContext(new MapNamespaceContext(namespaces));
        }
       
        // For each XPath
        for (String xpathString : xPaths) {
            // Get the matching nodes
View Full Code Here

        if (xpaths != null && !xpaths.isEmpty()) {
            XPathFactory factory = XPathFactory.newInstance();
            for (String expression : xpaths) {
                XPath xpath = factory.newXPath();
                if (namespaces != null) {
                    xpath.setNamespaceContext(new MapNamespaceContext(namespaces));
                }
                try {
                    NodeList list = (NodeList)xpath.evaluate(expression, saaj.getSOAPPart().getEnvelope(),
                                                   XPathConstants.NODESET);
                    for (int x = 0; x < list.getLength(); x++) {
                        Element el = (Element)list.item(x);
                        if (sign) {
                            WSEncryptionPart part = new WSEncryptionPart(el.getLocalName(),
                                                            el.getNamespaceURI(),
                                                            "Content",
                                                            WSConstants.PART_TYPE_ELEMENT);
                            part.setXpath(expression);
                            result.add(part);
                        } else {
                            WSEncryptionPart encryptedElem = new WSEncryptionPart(el.getLocalName(),
                                                                                  el.getNamespaceURI(),
                                                                                  "Element",
                                                                                  WSConstants
                                                                                      .PART_TYPE_ELEMENT);
                            encryptedElem.setXpath(expression);
                            String wsuId = el.getAttributeNS(WSConstants.WSU_NS, "Id");
                           
                            if (!StringUtils.isEmpty(wsuId)) {
                                encryptedElem.setEncId(wsuId);
                            }
                            result.add(encryptedElem);
                        }
                    }
                } catch (XPathExpressionException e) {
                    //REVISIT!!!!
                }
            }
        }
        if (contentXpaths != null && !contentXpaths.isEmpty()) {
            XPathFactory factory = XPathFactory.newInstance();
            for (String expression : contentXpaths) {
                XPath xpath = factory.newXPath();
                if (cnamespaces != null) {
                    xpath.setNamespaceContext(new MapNamespaceContext(cnamespaces));
                }
                try {
                    NodeList list = (NodeList)xpath.evaluate(expression, saaj.getSOAPPart().getEnvelope(),
                                                   XPathConstants.NODESET);
                    for (int x = 0; x < list.getLength(); x++) {
View Full Code Here

        doc.appendChild(element);
        return element;
    }
   
    protected ElementWriter getElementWriter(Element element) {
        return getElementWriter(element, new MapNamespaceContext());
    }
View Full Code Here

        return writeObjectToElement(type, bean, getContext());
    }

    protected Element writeObjectToElement(Type type, Object bean, Context context) {
        Element element = createElement("urn:Bean", "root", "b");
        ElementWriter writer = getElementWriter(element, new MapNamespaceContext());
        type.writeObject(bean, writer, getContext());
        writer.close();
        return element;
    }
View Full Code Here

                if (xpaths != null) {
                    XPathFactory factory = XPathFactory.newInstance();
                    for (String expression : xpaths) {
                        XPath xpath = factory.newXPath();
                        if (namespaces != null) {
                            xpath.setNamespaceContext(new MapNamespaceContext(namespaces));
                        }
                        try {
                            NodeList list = (NodeList)xpath.evaluate(expression,
                                                                     doc.getSOAPPart().getEnvelope(),
                                                                     XPathConstants.NODESET);
View Full Code Here

                Map<String, String> namespaces = rp.getDeclaredNamespaces();
                XPathFactory factory = XPathFactory.newInstance();
                for (String expression : rp.getXPathExpressions()) {
                    XPath xpath = factory.newXPath();
                    if (namespaces != null) {
                        xpath.setNamespaceContext(new MapNamespaceContext(namespaces));
                    }
                    NodeList list;
                    try {
                        list = (NodeList)xpath.evaluate(expression,
                                                                 header,
View Full Code Here

        if (xpaths != null && !xpaths.isEmpty()) {
            XPathFactory factory = XPathFactory.newInstance();
            for (String expression : xpaths) {
                XPath xpath = factory.newXPath();
                if (namespaces != null) {
                    xpath.setNamespaceContext(new MapNamespaceContext(namespaces));
                }
              
                NodeList list = (NodeList)xpath.evaluate(expression, saaj.getSOAPPart().getEnvelope(),
                                               XPathConstants.NODESET);
                for (int x = 0; x < list.getLength(); x++) {
View Full Code Here

                Map<String, String> namespaces = rp.getDeclaredNamespaces();
                XPathFactory factory = XPathFactory.newInstance();
                for (String expression : rp.getXPathExpressions()) {
                    XPath xpath = factory.newXPath();
                    if (namespaces != null) {
                        xpath.setNamespaceContext(new MapNamespaceContext(namespaces));
                    }
                    NodeList list;
                    try {
                        list = (NodeList)xpath.evaluate(expression,
                                                                 header,
View Full Code Here

        if (xpaths != null && !xpaths.isEmpty()) {
            XPathFactory factory = XPathFactory.newInstance();
            for (String expression : xpaths) {
                XPath xpath = factory.newXPath();
                if (namespaces != null) {
                    xpath.setNamespaceContext(new MapNamespaceContext(namespaces));
                }
              
                NodeList list = (NodeList)xpath.evaluate(expression, saaj.getSOAPPart().getEnvelope(),
                                               XPathConstants.NODESET);
                for (int x = 0; x < list.getLength(); x++) {
View Full Code Here

TOP

Related Classes of org.apache.cxf.helpers.MapNamespaceContext

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.