Package javax.xml.soap

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


        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

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

        QName qname1 = new QName("http://wombat.ztrade.com",
                                 "GetLastTradePrice", "ztrade");
        SOAPElement child = soapBody.addChildElement(qname1);
       
        assertFalse(child.getChildElements().hasNext());
       
        Document doc = child.getOwnerDocument();       
        String namespace = "http://example.com";
View Full Code Here

        assertFalse(soapBody.getChildElements().hasNext());
       
        QName qname1 = new QName("http://wombat.ztrade.com",
                                 "GetLastTradePrice", "ztrade");
        SOAPElement child = soapBody.addChildElement(qname1);
        child.addTextNode("foo");
       
        assertTrue(child.getChildElements().hasNext());
       
        Node textNode = (Node)child.getChildElements().next();
View Full Code Here

                    HttpRequest request, HttpResponse response) throws HttpException, IOException {

                try {
                    SOAPMessage message = MessageFactory.newInstance().createMessage();
                    SOAPBody body = message.getSOAPBody();
                    body.addChildElement("root");
                    response.setContentType(SOAPConstants.SOAP_1_1_CONTENT_TYPE);
                    message.writeTo(response.getOutputStream());
                    request.setHandled(true);
                } catch (SOAPException ex) {
                    throw new RuntimeException("Failed to generate SOAP message", ex);
View Full Code Here

      envelope.setEncodingStyle( XMLABaseComponent.ENCODING_STYLE );

      SOAPBody body = envelope.getBody();
      Name nEx = envelope.createName( "Execute", "", XMLABaseComponent.XMLA_URI ); //$NON-NLS-1$//$NON-NLS-2$

      SOAPElement eEx = body.addChildElement( nEx );
      eEx.setEncodingStyle( XMLABaseComponent.ENCODING_STYLE );

      // add the parameters

      // COMMAND parameter
View Full Code Here

      envelope.addNamespaceDeclaration( "xsi", "http://www.w3.org/2001/XMLSchema-instance" ); //$NON-NLS-1$//$NON-NLS-2$
      envelope.addNamespaceDeclaration( "xsd", "http://www.w3.org/2001/XMLSchema" ); //$NON-NLS-1$ //$NON-NLS-2$
      SOAPBody body = envelope.getBody();
      Name nDiscover = envelope.createName( "Discover", "", XMLABaseComponent.XMLA_URI ); //$NON-NLS-1$//$NON-NLS-2$

      SOAPElement eDiscover = body.addChildElement( nDiscover );
      eDiscover.setEncodingStyle( XMLABaseComponent.ENCODING_STYLE );

      Name nPara = envelope.createName( "RequestType", "", XMLABaseComponent.XMLA_URI ); //$NON-NLS-1$//$NON-NLS-2$
      SOAPElement eRequestType = eDiscover.addChildElement( nPara );
      eRequestType.addTextNode( request );
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.