Package javax.xml.soap

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


            {
                SOAPBody body = responseEnvelope.getBody();
                for ( int i = 0; i < responseBodyElems.size(); i++ )
                {
                    XmlObject responseBodyElem = (XmlObject) responseBodyElems.get( i );
                    body.addChildElement( createSOAPBodyElement( responseBodyElem ) );
                }
            }
            catch ( Exception e )
            {
                if ( e instanceof SOAPFaultException )
View Full Code Here


            String s = "MyName1";
            String p = "MyPrefix1";
            String u = "myURI";
            SOAPBody body = MessageFactory.newInstance().createMessage().getSOAPBody();
            SOAPElement myse = body.addNamespaceDeclaration(p, u);
            SOAPElement se = body.addChildElement(s, p);
            if (se == null) {
                fail("SOAPElement was null");
            } else {
                Iterator i = body.getChildElements();
                int count = getIteratorCount(i);
View Full Code Here

            SOAPEnvelope soapEnvelope = msg.getSOAPPart().getEnvelope();
            SOAPBody body = msg.getSOAPBody();

            Name name = soapEnvelope.createName("MyChild1");
            //Add child element Name object with localName=MyChild1
            SOAPElement se = body.addChildElement(name);
            if (se == null) {
                fail("addChildElement() did not return SOAPElement");
                //pass = false;
            } else {
                //Find the child element just added
View Full Code Here

            SOAPPart soapPart = message.getSOAPPart();
            SOAPEnvelope soapEnvelope = soapPart.getEnvelope();
            SOAPBody soapBody = soapEnvelope.getBody();

            Name name = soapEnvelope.createName("MyChild1");
            SOAPElement se = soapBody.addChildElement(name);
            Iterator childElementsCount = soapBody.getChildElements();
            Iterator childElements = soapBody.getChildElements();

            int childCount = 0;
            while (childElementsCount.hasNext()) {
View Full Code Here

            SOAPEnvelope soapEnvelope = soapPart.getEnvelope();
            SOAPBody soapBody = soapEnvelope.getBody();

            //Name name = soapEnvelope.createName("MyChild1");
            QName name = new QName("MyChild1");
            SOAPElement se = soapBody.addChildElement(name);
            Iterator childElementsCount = soapBody.getChildElements();
            Iterator childElements = soapBody.getChildElements();

            int childCount = 0;
            while (childElementsCount.hasNext()) {
View Full Code Here

            SOAPPart soapPart = message.getSOAPPart();
            SOAPEnvelope envelope = soapPart.getEnvelope();
            SOAPBody body = envelope.getBody();

            Name name = envelope.createName("MyChild");
            SOAPElement se = body.addChildElement(name);
            assertNotNull(se);
            Iterator childs = body.getChildElements(name);
            int childElementCount = 0;
            for (int a = 0; childs.hasNext(); a++) {
                childs.next();
View Full Code Here

            SOAPEnvelope envelope = soapPart.getEnvelope();
            SOAPBody body = envelope.getBody();

            QName qname1 = new QName("http://fooURI.com", "fooElement", "foo");
            QName qname2 = new QName("http://foo2URI.com", "fooElement2", "foo2");
            SOAPElement se = body.addChildElement(qname1);
            QName qname = se.getElementQName();
            se = se.setElementQName(qname2);
            qname = se.getElementQName();

            if (!qname.getNamespaceURI().equals(qname2.getNamespaceURI()) ||
View Full Code Here

                                  "shw",
                                  "http://www.jcommerce.net/soap/ns/SOAPHelloWorld");
        SOAPElement city = bodyElmnt.addChildElement(ns1);
        city.addTextNode("GENT");

        SOAPElement city2 = body.addChildElement(ns1);
        assertTrue(city2 instanceof SOAPBodyElement);
        city2.addTextNode("CIT2");

        Iterator it = body.getChildElements();
        int count = 0;
View Full Code Here

            SOAPMessage message = fact.createMessage();
            SOAPBody soapBody = message.getSOAPBody();

            QName qname1 = new QName("http://wombat.ztrade.com",
                                     "GetLastTradePrice", "ztrade");
            SOAPElement child1 = soapBody.addChildElement(qname1);
            Document document = soapBody.extractContentAsDocument();

            assertNotNull(document);
            assertTrue(document instanceof Document);
            Element element = document.getDocumentElement();
View Full Code Here

            {
                SOAPBody body = responseEnvelope.getBody();
                for ( int i = 0; i < responseBodyElems.size(); i++ )
                {
                    XmlObject responseBodyElem = (XmlObject) responseBodyElems.get( i );
                    body.addChildElement( createSOAPBodyElement( responseBodyElem ) );
                }
            }
            catch ( Exception e )
            {
                if ( e instanceof SOAPFaultException )
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.