Package org.apache.xmlbeans

Examples of org.apache.xmlbeans.XmlObject.selectPath()


                .getOutputParts(bindingOperation);
        messageParts.clear();

        if (WsdlUtils.isRpc(wsdlContext.getDefinition(), bindingOperation)) {
            // get root element
            XmlObject[] paths = msgXml.selectPath("declare namespace env='"
                    + wsdlContext.getSoapVersion().getEnvelopeNamespace() + "';" + "declare namespace ns='"
                    + WsdlUtils.getTargetNamespace(wsdlContext.getDefinition()) + "';" + "$this/env:Envelope/env:Body/ns:"
                    + bindingOperation.getName());

            if (paths.length != 1) {
View Full Code Here


                    result.put(wsdlUrl, xmlObject);
                }
            } else {
                existing.put(wsdlUrl, null);

                XmlObject[] paths = xmlObject.selectPath("declare namespace s='" + Constants.XSD_NS + "' .//s:schema");

                for (int i = 0; i < paths.length; i++) {
                    XmlCursor xmlCursor = paths[i].newCursor();
                    String xmlText = xmlCursor.getObject().xmlText(options);
View Full Code Here

    private void expandMtomAttachments(WsdlRequest wsdlRequest) {
        try {
            // XmlObject xmlObject = XmlObject.Factory.parse( getContentAsString()
            // );
            XmlObject xmlObject = XmlUtils.createXmlObject(getContentAsString());
            XmlObject[] includes = xmlObject
                    .selectPath("declare namespace xop='http://www.w3.org/2004/08/xop/include'; //xop:Include");

            for (XmlObject include : includes) {
                Element elm = (Element) include.getDomNode();
                String href = elm.getAttribute("href");
View Full Code Here

        List<XmlObject> result = new ArrayList<XmlObject>();

        if (WsdlUtils.isRpc(wsdlContext.getDefinition(), bindingOperation)) {
            // get root element
            XmlObject[] paths = msgXml.selectPath("declare namespace env='"
                    + wsdlContext.getSoapVersion().getEnvelopeNamespace() + "';" + "declare namespace ns='"
                    + WsdlUtils.getTargetNamespace(wsdlContext.getDefinition()) + "';" + "$this/env:Envelope/env:Body/ns:"
                    + bindingOperation.getName() + (isResponse ? "Response" : ""));

            if (paths.length != 1) {
View Full Code Here

                    xmlOptions.setLoadLineNumbers(XmlOptions.LOAD_LINE_NUMBERS_END_ELEMENT);
                    // XmlObject xml = XmlObject.Factory.parse( message, xmlOptions
                    // );
                    XmlObject xml = XmlUtils.createXmlObject(message, xmlOptions);

                    XmlObject[] paths = xml.selectPath("declare namespace env='"
                            + wsdlContext.getSoapVersion().getEnvelopeNamespace() + "';"
                            + "$this/env:Envelope/env:Body/env:Fault");

                    if (paths.length > 0) {
                        validateSoapFault(bindingOperation, paths[0], errors);
View Full Code Here

        // check manually before resource intensive xpath
        if (responseContent.indexOf(":Fault") > 0 || responseContent.indexOf("<Fault") > 0) {
            // XmlObject xml = XmlObject.Factory.parse( responseContent );
            XmlObject xml = XmlUtils.createXmlObject(responseContent);
            XmlObject[] paths = xml.selectPath("declare namespace env='" + soapVersion.getEnvelopeNamespace() + "';"
                    + "//env:Fault");
            if (paths.length > 0) {
                return true;
            }
        }
View Full Code Here

    }

    public static String removeEmptySoapHeaders(String content, SoapVersion soapVersion) throws XmlException {
        // XmlObject xmlObject = XmlObject.Factory.parse( content );
        XmlObject xmlObject = XmlUtils.createXmlObject(content);
        XmlObject[] selectPath = xmlObject.selectPath("declare namespace soap='" + soapVersion.getEnvelopeNamespace()
                + "';/soap:Envelope/soap:Header");
        if (selectPath.length > 0) {
            Node domNode = selectPath[0].getDomNode();
            if (!domNode.hasChildNodes() && !domNode.hasAttributes()) {
                domNode.getParentNode().removeChild(domNode);
View Full Code Here

    public static String transferSoapHeaders(String requestContent, String newRequest, SoapVersion soapVersion) {
        try {
            // XmlObject source = XmlObject.Factory.parse( requestContent );
            XmlObject source = XmlUtils.createXmlObject(requestContent);
            String headerXPath = "declare namespace ns='" + soapVersion.getEnvelopeNamespace() + "'; //ns:Header";
            XmlObject[] header = source.selectPath(headerXPath);
            if (header.length == 1) {
                Element headerElm = (Element) header[0].getDomNode();
                NodeList childNodes = headerElm.getChildNodes();
                if (childNodes.getLength() > 0) {
                    // XmlObject dest = XmlObject.Factory.parse( newRequest );
View Full Code Here

                Element headerElm = (Element) header[0].getDomNode();
                NodeList childNodes = headerElm.getChildNodes();
                if (childNodes.getLength() > 0) {
                    // XmlObject dest = XmlObject.Factory.parse( newRequest );
                    XmlObject dest = XmlUtils.createXmlObject(newRequest);
                    header = dest.selectPath(headerXPath);
                    Element destElm = null;

                    if (header.length == 0) {
                        Element docElm = ((Document) dest.getDomNode()).getDocumentElement();
View Full Code Here

                // XmlObject xmlObject = XmlObject.Factory.parse(
                // testRequest.getResponse().getContentAsXml() );
                XmlObject xmlObject = XmlUtils.createXmlObject(testRequest.getResponse().getContentAsXml());

                String expression = PropertyExpander.expandProperties(context, getExpression());
                XmlObject[] selectPath = xmlObject.selectPath(expression);
                if (selectPath.length == 1 && selectPath[0] instanceof XmlBoolean) {
                    if (((XmlBoolean) selectPath[0]).getBooleanValue()) {
                        return true;
                    }
                }
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.