Package javax.xml.stream

Examples of javax.xml.stream.XMLStreamReader.nextTag()


                                + xmlReader.getName() + " at ["
                                + xmlReader.getLocation().getLineNumber() + ","
                                + xmlReader.getLocation().getColumnNumber()
                                + "]. Expecting 'Envelope'.");
            }
            xmlReader.nextTag();
            if (xmlReader.getName().equals(soapVersion.getHeader())) {
                Map<QName, DocumentFragment> headers = message.getSoapHeaders();
                while (xmlReader.nextTag() != XMLStreamConstants.END_ELEMENT) {
                    QName hn = xmlReader.getName();
                    Element e = StaxUtil.createElement(xmlReader);
View Full Code Here


                                + "]. Expecting 'Envelope'.");
            }
            xmlReader.nextTag();
            if (xmlReader.getName().equals(soapVersion.getHeader())) {
                Map<QName, DocumentFragment> headers = message.getSoapHeaders();
                while (xmlReader.nextTag() != XMLStreamConstants.END_ELEMENT) {
                    QName hn = xmlReader.getName();
                    Element e = StaxUtil.createElement(xmlReader);
                    DocumentFragment df = headers.get(hn);
                    if (df == null) {
                        df = e.getOwnerDocument().createDocumentFragment();
View Full Code Here

                    }
                    e = (Element) df.getOwnerDocument().importNode(e, true);
                    df.appendChild(e);
                    headers.put(hn, df);
                }
                xmlReader.nextTag();
            }
            if (!xmlReader.getName().equals(soapVersion.getBody())) {
                throw new SoapFault(SoapFault.SENDER, "Unrecognized element: "
                                + xmlReader.getName() + ". Expecting 'Body'.");
            }
View Full Code Here

            }
            if (!xmlReader.getName().equals(soapVersion.getBody())) {
                throw new SoapFault(SoapFault.SENDER, "Unrecognized element: "
                                + xmlReader.getName() + ". Expecting 'Body'.");
            }
            if (xmlReader.nextTag() == XMLStreamConstants.END_ELEMENT) {
                // Empty body
                message.setContent(XMLStreamReader.class, null);
            }
        } catch (XMLStreamException e) {
            throw new Fault(e);
View Full Code Here

        String input = "<hello />";
       
        Message message = new MessageImpl();
        message.put(Operation.class, wsdlOperation);
        XMLStreamReader reader = StaxUtil.createReader(new ByteArrayInputStream(input.getBytes()));
        reader.nextTag();
        message.setContent(XMLStreamReader.class, reader);
       
        JbiInWsdl1Interceptor interceptor = new JbiInWsdl1Interceptor(true);
        interceptor.handleMessage(message);
        Source source = message.getContent(Source.class);
View Full Code Here

                    reader = new ExtendedXMLStreamReader(reader);
                } else {
                    return;
                }
            }
            reader.nextTag();
            message.setContent(XMLStreamReader.class, reader);
        } catch (XMLStreamException e) {
            throw new Fault(e);
        }
    }
View Full Code Here

    private Message createDefaultMessage(String str) throws Exception {
        Message message = new MessageImpl();
        message.put(Binding.class, binding);
        XMLStreamReader reader = StaxUtil.createReader(new ByteArrayInputStream(str.getBytes()));
        message.setContent(XMLStreamReader.class, reader);
        reader.nextTag();
        return message;
    }
   
}
View Full Code Here

    }

    @Test
    public void testCompile() throws Exception {
        XMLStreamReader reader = staxHelper.createXMLStreamReader(XPATH);
        reader.nextTag();
        String xpath = reader.getAttributeValue(null, "attachTo");
        XPathExpression expression = xpathHelper.compile(reader.getNamespaceContext(), xpath);
        // Advance the reader so that the namespace context changes its prefix/namespace mapping
        reader.nextTag();
        reader.close();
View Full Code Here

        XMLStreamReader reader = staxHelper.createXMLStreamReader(XPATH);
        reader.nextTag();
        String xpath = reader.getAttributeValue(null, "attachTo");
        XPathExpression expression = xpathHelper.compile(reader.getNamespaceContext(), xpath);
        // Advance the reader so that the namespace context changes its prefix/namespace mapping
        reader.nextTag();
        reader.close();

        Document doc = domHelper.load(XML);
        NodeList nodes = (NodeList)expression.evaluate(doc, XPathConstants.NODESET);
        Assert.assertEquals(1, nodes.getLength());
View Full Code Here

    }

    @Test
    public void testCompile2() throws Exception {
        XMLStreamReader reader = staxHelper.createXMLStreamReader(XPATH);
        reader.nextTag();
        String xpathExp = reader.getAttributeValue(null, "attachTo");
        XPath xpath = xpathHelper.newXPath();
        // Compile the expression without taking a snapshot of the namespace context
        XPathExpression expression = xpathHelper.compile(xpath, reader.getNamespaceContext(), xpathExp);
        // Advance the reader so that the namespace context changes its prefix/namespace mapping
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.