Package javax.xml.soap

Examples of javax.xml.soap.SOAPEnvelope.createName()


     */
    public static Name toName(QName qName, SOAPElement resolveElement) throws SOAPException {
      String qNamePrefix = qName.getPrefix();
        SOAPEnvelope envelope = getEnvelope(resolveElement);
        if (StringUtils.hasLength(qName.getNamespaceURI()) && StringUtils.hasLength(qNamePrefix)) {
            return envelope.createName(qName.getLocalPart(), qNamePrefix, qName.getNamespaceURI());
        }
        else if (StringUtils.hasLength(qName.getNamespaceURI())) {
            Iterator<?> prefixes;
            if (getSaajVersion(resolveElement) == SAAJ_11) {
                prefixes = resolveElement.getNamespacePrefixes();
View Full Code Here


                prefixes = resolveElement.getVisibleNamespacePrefixes();
            }
            while (prefixes.hasNext()) {
                String prefix = (String) prefixes.next();
                if (qName.getNamespaceURI().equals(resolveElement.getNamespaceURI(prefix))) {
                    return envelope.createName(qName.getLocalPart(), prefix, qName.getNamespaceURI());
                }
            }
            return envelope.createName(qName.getLocalPart(), "", qName.getNamespaceURI());
        }
        else {
View Full Code Here

                String prefix = (String) prefixes.next();
                if (qName.getNamespaceURI().equals(resolveElement.getNamespaceURI(prefix))) {
                    return envelope.createName(qName.getLocalPart(), prefix, qName.getNamespaceURI());
                }
            }
            return envelope.createName(qName.getLocalPart(), "", qName.getNamespaceURI());
        }
        else {
            return envelope.createName(qName.getLocalPart());
        }
    }
View Full Code Here

                }
            }
            return envelope.createName(qName.getLocalPart(), "", qName.getNamespaceURI());
        }
        else {
            return envelope.createName(qName.getLocalPart());
        }
    }

    /**
     * Converts a {@code javax.xml.soap.Name} to a {@code javax.xml.namespace.QName}.
View Full Code Here

        SOAPPart sp = msg.getSOAPPart();
        SOAPEnvelope envelope = sp.getEnvelope();
        SOAPHeader header = envelope.getHeader();
        SOAPBody body = envelope.getBody();

        SOAPElement el = header.addHeaderElement(envelope.createName("field4", NS_PREFIX, NS_URI));
        SOAPElement el2 = el.addChildElement("field4b", NS_PREFIX);
        SOAPElement el3 = el2.addTextNode("field4value");

        el = body.addBodyElement(envelope.createName("bodyfield3", NS_PREFIX, NS_URI));
        el2 = el.addChildElement("bodyfield3a", NS_PREFIX);
View Full Code Here

        SOAPElement el = header.addHeaderElement(envelope.createName("field4", NS_PREFIX, NS_URI));
        SOAPElement el2 = el.addChildElement("field4b", NS_PREFIX);
        SOAPElement el3 = el2.addTextNode("field4value");

        el = body.addBodyElement(envelope.createName("bodyfield3", NS_PREFIX, NS_URI));
        el2 = el.addChildElement("bodyfield3a", NS_PREFIX);
        el2.addTextNode("bodyvalue3a");
        el2 = el.addChildElement("bodyfield3b", NS_PREFIX);
        el2.addTextNode("bodyvalue3b");
        el2 = el.addChildElement("datefield", NS_PREFIX);
View Full Code Here

    // Test JAXM methods...

    public void testName() throws Exception {
        SOAPEnvelope env = new org.apache.axis.message.SOAPEnvelope();
        Name n = env.createName("local", "pref", "urn:blah");
        assertEquals("local part of name did not match", "local",
                     n.getLocalName());
        assertEquals("qname of name did not match", "pref:local",
                     n.getQualifiedName());
        assertEquals("prefix of name did not match", "pref",
View Full Code Here

                     n.getQualifiedName());
        assertEquals("prefix of name did not match", "pref",
                     n.getPrefix());
        assertEquals("uri of name did not match", "urn:blah",
                     n.getURI());
        Name n2 = env.createName("loc");
        assertEquals("local part of name2 did not match", "loc",
                     n2.getLocalName());
    }

    public void testHeader() throws Exception {
View Full Code Here

         */
        SOAPBody soapBody = soapEnvelope.getBody();
        /**
         * Create a name object. with name space http://www.sun.com/imq.
         */
        Name name = soapEnvelope.createName("HelloWorld", "hw", "http://www.sun.com/imq");
        /**
         * Add child element with the above name.
         */
        SOAPElement element = soapBody.addChildElement(name);

View Full Code Here

    public void testAttributes() throws Exception {
        SOAPEnvelope envelope = getSOAPEnvelope();
        SOAPBody body = envelope.getBody();

        Name name1 = envelope.createName("MyAttr1");
        String value1 = "MyValue1";
        Name name2 = envelope.createName("MyAttr2");
        String value2 = "MyValue2";
        Name name3 = envelope.createName("MyAttr3");
        String value3 = "MyValue3";
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.