Package javax.xml.soap

Examples of javax.xml.soap.SOAPHeader.appendChild()


        symbol.setAttribute("foo", "bar");
        getLastTradePrice.appendChild(symbol);
        org.w3c.dom.Text def = doc.createTextNode("DEF");
        symbol.appendChild(def);
                       
        soapHeader.appendChild(getLastTradePrice);
               
        assertEquals(1, soapHeader.getChildNodes().getLength());
        Iterator iter = soapHeader.getChildElements();
        assertTrue(iter.hasNext());
        Object obj = iter.next();
View Full Code Here


        symbol.setAttribute("foo", "bar");
        getLastTradePrice.appendChild(symbol);
        org.w3c.dom.Text def = doc.createTextNode("DEF");
        symbol.appendChild(def);
                       
        soapHeader.appendChild(getLastTradePrice);
               
        assertEquals(1, soapHeader.getChildNodes().getLength());
        Iterator iter = soapHeader.getChildElements();
        assertTrue(iter.hasNext());
        Object obj = iter.next();
View Full Code Here

        Document doc = message.getSOAPPart();
        Element orgElement = doc.createElementNS("urn:ns", "ns:test");
        orgElement.appendChild(doc.createElementNS(null, "child1"));
        orgElement.appendChild(doc.createElementNS(null, "child2"));
        orgElement.appendChild(doc.createElementNS(null, "child3"));
        header.appendChild(orgElement);
       
        SOAPElement element = (SOAPElement)header.getChildElements().next();
        assertTrue(element instanceof SOAPHeaderElement);
        assertEquals(3, element.getChildNodes().getLength());
    }
View Full Code Here

                QName qname = XMLHelper.createQName(name);
                boolean qualifiedForSoapHeader = Strings.trimToNull(qname.getNamespaceURI()) != null;
                if (qualifiedForSoapHeader && matches(qname)) {
                    if (value instanceof Node) {
                        Node domNode = soapHeader.getOwnerDocument().importNode((Node)value, true);
                        soapHeader.appendChild(domNode);
                    } else if (value instanceof Configuration) {
                        Element configElement = new ElementPuller().pull(new StringReader(value.toString()));
                        Node configNode = soapHeader.getOwnerDocument().importNode(configElement, true);
                        soapHeader.appendChild(configNode);
                    } else {
View Full Code Here

                        Node domNode = soapHeader.getOwnerDocument().importNode((Node)value, true);
                        soapHeader.appendChild(domNode);
                    } else if (value instanceof Configuration) {
                        Element configElement = new ElementPuller().pull(new StringReader(value.toString()));
                        Node configNode = soapHeader.getOwnerDocument().importNode(configElement, true);
                        soapHeader.appendChild(configNode);
                    } else {
                        String v = value.toString();
                        if (SOAPHeadersType.XML.equals(_soapHeadersType)) {
                            try {
                                Element xmlElement = new ElementPuller().pull(new StringReader(v));
View Full Code Here

                        String v = value.toString();
                        if (SOAPHeadersType.XML.equals(_soapHeadersType)) {
                            try {
                                Element xmlElement = new ElementPuller().pull(new StringReader(v));
                                Node xmlNode = soapHeader.getOwnerDocument().importNode(xmlElement, true);
                                soapHeader.appendChild(xmlNode);
                            } catch (Throwable t) {
                                soapHeader.addChildElement(qname).setValue(v);
                            }
                        } else {
                            soapHeader.addChildElement(qname).setValue(v);
View Full Code Here

                d = d.getFirstChild();
            SOAPHeader header = saaj.getSOAPHeader();
            if(header == null)
                header = saaj.getSOAPPart().getEnvelope().addHeader();
            Node node = header.getOwnerDocument().importNode(d, true);
            header.appendChild(node);
        } catch (Exception e) {
            throw new SOAPException(e);
        }
    }
View Full Code Here

    public void writeTo(SOAPMessage saaj) throws SOAPException {
        SOAPHeader header = saaj.getSOAPHeader();
        if(header == null)
            header = saaj.getSOAPPart().getEnvelope().addHeader();
        Node clone = header.getOwnerDocument().importNode(node,true);
        header.appendChild(clone);
    }

    @Override
    public String getStringContent() {
        return node.getTextContent();
View Full Code Here

        symbol.setAttribute("foo", "bar");
        getLastTradePrice.appendChild(symbol);
        org.w3c.dom.Text def = doc.createTextNode("DEF");
        symbol.appendChild(def);
                       
        soapHeader.appendChild(getLastTradePrice);
               
        assertEquals(1, soapHeader.getChildNodes().getLength());
        Iterator iter = soapHeader.getChildElements();
        assertTrue(iter.hasNext());
        Object obj = iter.next();
View Full Code Here

            Node d = result.getNode();
            if(d.getNodeType() == Node.DOCUMENT_NODE)
                d = d.getFirstChild();
            SOAPHeader header = saaj.getSOAPHeader();
            Node node = header.getOwnerDocument().importNode(d, true);
            header.appendChild(node);
        } catch (Exception e) {
            throw new SOAPException(e);
        }
    }
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.