Package javax.xml.soap

Examples of javax.xml.soap.SOAPElement.addAttribute()


        Name elementName2 = sf.createName("UKAddress", "", "http://apache.org/type_test");
        Name xsiAttrName2 = sf.createName("type", "xsi", "http://www.w3.org/2001/XMLSchema-instance");
        SOAPElement x2 = sf.createElement(elementName2);
        x2.addNamespaceDeclaration("tns", "http://apache.org/type_test");
        x2.addNamespaceDeclaration("xsi", "http://www.w3.org/2001/XMLSchema-instance");
        x2.addAttribute(xsiAttrName2, "tns:UKAddressType22");
        x2.addTextNode("This is the text of the node for the second struct");

        swa.setAny(x);
        yOrig.setAny(x2);
View Full Code Here


        Name elementName = sf.createName("UKAddress", "", "http://apache.org/type_test");
        Name xsiAttrName = sf.createName("type", "xsi", "http://www.w3.org/2001/XMLSchema-instance");
        SOAPElement x = sf.createElement(elementName);
        x.addNamespaceDeclaration("tns", "http://apache.org/type_test");
        x.addNamespaceDeclaration("xsi", "http://www.w3.org/2001/XMLSchema-instance");
        x.addAttribute(xsiAttrName, "tns:UKAddressType11");
        x.addTextNode("This is the text of the node for the first struct");

        Name elementName2 = sf.createName("UKAddress", "", "http://apache.org/type_test");
        Name xsiAttrName2 = sf.createName("type", "xsi", "http://www.w3.org/2001/XMLSchema-instance");
        SOAPElement x2 = sf.createElement(elementName2);
View Full Code Here

        Name elementName2 = sf.createName("UKAddress", "", "http://apache.org/type_test");
        Name xsiAttrName2 = sf.createName("type", "xsi", "http://www.w3.org/2001/XMLSchema-instance");
        SOAPElement x2 = sf.createElement(elementName2);
        x2.addNamespaceDeclaration("tns", "http://apache.org/type_test");
        x2.addNamespaceDeclaration("xsi", "http://www.w3.org/2001/XMLSchema-instance");
        x2.addAttribute(xsiAttrName2, "tns:UKAddressType22");
        x2.addTextNode("This is the text of the node for the second struct");

        swa.setAny(x);
        yOrig.setAny(x2);
View Full Code Here

        SOAPHeader header = envelope.addHeader();

        SOAPElement security = header.addChildElement("Security", "wsse", "http://docs.oasis-open.org/wss/2004/01/oasis-200401-wss-wssecurity-secext-1.0.xsd");

        SOAPElement usernameToken = security.addChildElement("UsernameToken", "wsse");
        usernameToken.addAttribute(new QName("xmlns:wsu"), "http://docs.oasis-open.org/wss/2004/01/oasis-200401-wss-wssecurity-utility-1.0.xsd");

        SOAPElement username = usernameToken.addChildElement("Username", "wsse");
        username.addTextNode(this.username);

        SOAPElement password = usernameToken.addChildElement("Password", "wsse");
View Full Code Here

        Name elementName = sf.createName("UKAddress", "", "http://apache.org/type_test");
        Name xsiAttrName = sf.createName("type", "xsi", "http://www.w3.org/2001/XMLSchema-instance");
        SOAPElement x = sf.createElement(elementName);
        x.addNamespaceDeclaration("tns", "http://apache.org/type_test");
        x.addNamespaceDeclaration("xsi", "http://www.w3.org/2001/XMLSchema-instance");
        x.addAttribute(xsiAttrName, "tns:UKAddressType11");
        x.addTextNode("This is the text of the node for the first struct");

        Name elementName2 = sf.createName("UKAddress", "", "http://apache.org/type_test");
        Name xsiAttrName2 = sf.createName("type", "xsi", "http://www.w3.org/2001/XMLSchema-instance");
        SOAPElement x2 = sf.createElement(elementName2);
View Full Code Here

        Name elementName2 = sf.createName("UKAddress", "", "http://apache.org/type_test");
        Name xsiAttrName2 = sf.createName("type", "xsi", "http://www.w3.org/2001/XMLSchema-instance");
        SOAPElement x2 = sf.createElement(elementName2);
        x2.addNamespaceDeclaration("tns", "http://apache.org/type_test");
        x2.addNamespaceDeclaration("xsi", "http://www.w3.org/2001/XMLSchema-instance");
        x2.addAttribute(xsiAttrName2, "tns:UKAddressType22");
        x2.addTextNode("This is the text of the node for the second struct");

        swa.setAny(x);
        yOrig.setAny(x2);
View Full Code Here

        SOAPElement mainChildEle = bodyElement.addChildElement(nameMain);

        Name ns2 = env.createName("text");
        SOAPElement textReference = mainChildEle.addChildElement(ns2);
        Name hrefAttr = env.createName("href");
        textReference.addAttribute(hrefAttr, "cid:submitSampleText@apache.org");

        Name ns3 = env.createName("image");
        SOAPElement imageReference = mainChildEle.addChildElement(ns3);
        Name ns31 = env.createName("inner");
        final SOAPElement img = imageReference.addChildElement(ns31);
View Full Code Here

        Name ns3 = env.createName("image");
        SOAPElement imageReference = mainChildEle.addChildElement(ns3);
        Name ns31 = env.createName("inner");
        final SOAPElement img = imageReference.addChildElement(ns31);
        img.addAttribute(hrefAttr, "cid:submitSampleImage@apache.org");

        Name ns4 = env.createName("plaintxt");
        SOAPElement plainTxt = mainChildEle.addChildElement(ns4);
        plainTxt.addTextNode("This is simple plain text");
View Full Code Here

                                                    omChildQName.getNamespaceURI());
                    for (Iterator attribIter = omChildEle.getAllAttributes();
                         attribIter.hasNext();) {
                        OMAttribute attr = (OMAttribute) attribIter.next();
                        final QName attrQName = attr.getQName();
                        saajChildEle.addAttribute(saajSOAPMsg.getSOAPPart().getEnvelope().
                                createName(attrQName.getLocalPart(),
                                           attrQName.getPrefix(),
                                           attrQName.getNamespaceURI()),
                                                  attr.getAttributeValue());
                    }
View Full Code Here

      SOAPEnvelope soapEnvelope = soapPart.getEnvelope();
      soapEnvelope.getBody().detachNode();
      SOAPBody soapBody = soapEnvelope.addBody();
      SOAPBodyElement echoElement = soapBody.addBodyElement(soapEnvelope.createName("echo", "ns1", "http://soapinterop.org/"));
      SOAPElement argElement = echoElement.addChildElement("arg0");
      argElement = argElement.addAttribute(soapEnvelope.createName("type", "xsi", "http://www.w3.org/2001/XMLSchema-instance"), "xsd:string");
      argElement.addTextNode("my echo string");
      soapMsg.saveChanges();
     
  } catch (Exception e) {
      e.printStackTrace();
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.