Package javax.xml.soap

Examples of javax.xml.soap.SOAPBody.addBodyElement()


        myName.addTextNode("Tony");
        Name ns = env.createName("Address",
                                 "shw",
                                 "http://www.jcommerce.net/soap/ns/SOAPHelloWorld");
        SOAPBody body = env.getBody();
        SOAPElement bodyElmnt = body.addBodyElement(ns);
        Name ns1 = env.createName("City",
                                  "shw",
                                  "http://www.jcommerce.net/soap/ns/SOAPHelloWorld");
        SOAPElement city = bodyElmnt.addChildElement(ns1);
        city.addTextNode("GENT");
View Full Code Here


    @Validated @Test
    public void testAddRemoveTextNode() throws Exception {
        MessageFactory mf = MessageFactory.newInstance();
        SOAPMessage msg = mf.createMessage();
        SOAPBody body = msg.getSOAPBody();
        SOAPBodyElement bodyChild = body.addBodyElement(new QName("TestChild"));
        bodyChild.addTextNode("aaaaa");
        bodyChild.removeChild(bodyChild.getFirstChild());
    }
}
View Full Code Here

            // required part of the message as per the SOAP 1.1 spec.
            SOAPPart sp = msg.getSOAPPart();
            SOAPEnvelope envelope = sp.getEnvelope();
            SOAPHeader hdr = envelope.getHeader();
            SOAPBody bdy = envelope.getBody();
            SOAPBodyElement sbe1 = bdy.addBodyElement(
                    envelope.createName("Body1", NS_PREFIX, NS_URI));
            sbe1.addChildElement(envelope.createName(
                    "TheGifAttachment", NS_PREFIX, NS_URI));
            sbe1.setAttribute("href", "cid:THEGIF");
            SOAPBodyElement sbe2 = bdy.addBodyElement(
View Full Code Here

            SOAPBodyElement sbe1 = bdy.addBodyElement(
                    envelope.createName("Body1", NS_PREFIX, NS_URI));
            sbe1.addChildElement(envelope.createName(
                    "TheGifAttachment", NS_PREFIX, NS_URI));
            sbe1.setAttribute("href", "cid:THEGIF");
            SOAPBodyElement sbe2 = bdy.addBodyElement(
                    envelope.createName("Body2", NS_PREFIX, NS_URI));
            sbe2.addChildElement(envelope.createName(
                    "TheXmlAttachment", NS_PREFIX, NS_URI));
            sbe2.setAttribute("href", "cid:THEXML");
View Full Code Here

            SOAPPart sp = msg.getSOAPPart();
            SOAPEnvelope envelope = sp.getEnvelope();
            SOAPHeader hdr = envelope.getHeader();

            SOAPBody bdy = envelope.getBody();
            SOAPBodyElement sbe1 = bdy.addBodyElement(
                    envelope.createName("Body1", NS_PREFIX, NS_URI));
            sbe1.addChildElement(envelope.createName(
                    "TheGifAttachment", NS_PREFIX, NS_URI));

            SOAPBodyElement sbe2 = bdy.addBodyElement(
View Full Code Here

            SOAPBodyElement sbe1 = bdy.addBodyElement(
                    envelope.createName("Body1", NS_PREFIX, NS_URI));
            sbe1.addChildElement(envelope.createName(
                    "TheGifAttachment", NS_PREFIX, NS_URI));

            SOAPBodyElement sbe2 = bdy.addBodyElement(
                    envelope.createName("Body2", NS_PREFIX, NS_URI));

            sbe2.addChildElement(envelope.createName(
                    "TheXmlAttachment", NS_PREFIX, NS_URI));
View Full Code Here

                    envelope.createName("Header4", NS_PREFIX, NS_URI))
                    .addTextNode("This is Header4");
            she = (SOAPHeaderElement)se;
            she.setMustUnderstand(false);

            SOAPBodyElement sbe = bdy.addBodyElement(
                    envelope.createName("Body1", NS_PREFIX, NS_URI));

            sbe.addChildElement(envelope.createName(
                    "Child1", NS_PREFIX, NS_URI)).addTextNode("This is Child1");
            sbe.addChildElement(envelope.createName(
View Full Code Here

      SOAPHeaderElement resourceIdHeader =
         soapHeader.addHeaderElement( NameUtils.toName( MuseAddressingConstants.REFERENCE_PROP_QNAME_RESOURCE_ID ) );
      SaajUtils.addTextNode( resourceIdHeader, m_resourceId );
      SOAPBody        soapBody    = soapRequestMsg.getSOAPPart(  ).getEnvelope(  ).getBody(  );
      SOAPBodyElement requestElem =
         soapBody.addBodyElement( SOAPFactory.newInstance(  ).createName( "GetResourcePropertyRequest",
                                                                          ResourceProperties11Constants.NSPREFIX_WSRP,
                                                                          ResourceProperties11Constants.NSURI_WSRP ) );
      requestElem.addNamespaceDeclaration( propQName.getPrefix(  ),
                                           propQName.getNamespaceURI(  ) );
      SaajUtils.addTextNode( requestElem, propQName.getPrefix(  ) + ":" + propQName.getLocalPart(  ) );
View Full Code Here

            SOAPHeader header = message.getSOAPHeader();
            header.detachNode();
           
            SOAPBody body = message.getSOAPBody();
            QName bodyName = new QName("http://www.lokasoft.nl/message/", "ProbePosition", "m");
            SOAPBodyElement bodyElement = body.addBodyElement(bodyName);
            QName name = new QName("fen");
            SOAPElement fenElement = bodyElement.addChildElement(name);
            fenElement.addTextNode(fen);
           
            URL endpoint = new URL("http://www.lokasoft.nl/tbweb/tbapi.asp");
View Full Code Here

            SOAPHeader header = message.getSOAPHeader();
            header.detachNode();
           
            SOAPBody body = message.getSOAPBody();
            QName bodyName = new QName("http://www.lokasoft.nl/message/", "GetBestMoves", "m");
            SOAPBodyElement bodyElement = body.addBodyElement(bodyName);
            QName name = new QName("fen");
            SOAPElement fenElement = bodyElement.addChildElement(name);
            fenElement.addTextNode(fen);
           
            URL endpoint = new URL("http://www.lokasoft.nl/tbweb/tbapi.asp");
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.