Package javax.xml.soap

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


         // payload is fault
         if (atPartMargin())
         {
            SOAPBody soapBody = soapEnv.getBody();
            SOAPFaultImpl soapFault = new SOAPFaultImpl(soapEnv.getPrefix(), soapEnv.getNamespaceURI());
            soapBody.addChildElement(soapFault);
            destElement = soapFault;
            previousPart = Part.FAULT;
         }

         if (fragmentRootCursor == null)
View Full Code Here


        cdataElem.appendChild(cdata);
   
        input[2] = new SOAPBodyElement(cdataElem);
       
        for(int i=0; i<input.length; i++) {
            body.addChildElement(input[i]);
        }
       
        ByteArrayInputStream bais = new ByteArrayInputStream(env.toString().getBytes());
        SOAPEnvelope env2 = new org.apache.axis.message.SOAPEnvelope(bais);
       
View Full Code Here

        commentsElem.appendChild(text);
   
        input[2] = new SOAPBodyElement(commentsElem);
       
        for(int i=0; i<input.length; i++) {
            body.addChildElement(input[i]);
        }
       
        ByteArrayInputStream bais = new ByteArrayInputStream(env.toString().getBytes());
        SOAPEnvelope env2 = new org.apache.axis.message.SOAPEnvelope(bais);
       
View Full Code Here

        RPCElement body = new RPCElement("urn:myNamespace", "method1",
                new Object[]{arg1, arg2});
        SOAPPart sp = message.getSOAPPart();
        SOAPEnvelope se = sp.getEnvelope();
        SOAPBody sb = se.getBody();
        sb.addChildElement(body);
        Iterator it = sb.getChildElements();
        assertTrue(it.hasNext());

        SOAPElement elem = (SOAPElement) it.next();
View Full Code Here

      assertEquals("env:Envelope", env.getNodeName());
      assertEquals(Constants.NS_SOAP11_ENV, env.getNamespaceURI());
     
      SOAPBody soapBody = env.getBody();
      SOAPBodyElement soapBodyElement = (SOAPBodyElement)soapBody.addChildElement("businessList");
      soapBodyElement.addNamespaceDeclaration("", "urn:uddi-org:api_v2");
     
      String expEnvStr =
         "<env:Envelope xmlns:env='http://schemas.xmlsoap.org/soap/envelope/'>" +
         " <env:Header/>" +
View Full Code Here

      // Create a soap body from the envelope.
      SOAPBody bdy = envelope.getBody();

      // Add a soap body element
      SOAPElement sbe = bdy.addChildElement(new SOAPBodyElementRpc(envelope.createName(rpcMethodName, NS_PREFIX, TARGET_NAMESPACE)));

      // Add a some child elements
      sbe.addChildElement(envelope.createName("message")).addTextNode("Some text message");
      return msg;
   }
View Full Code Here

      SOAPMessage soapMessage = msgFactory.createMessage();
      SOAPEnvelope env = soapMessage.getSOAPPart().getEnvelope();
      SOAPBody body = env.getBody();

      Name name = soapFactory.createName("MyChild1");
      SOAPElement se = body.addChildElement(name);
      assertNotNull("Expected an element", se);

      assertEquals("Expected 1 child element", 1, getIteratorCount(body.getChildElements()));

      SOAPElement se2 = (SOAPElement)body.getChildElements().next();
View Full Code Here

      String u = "myURI";

      body.addNamespaceDeclaration(p, u);
      assertEquals(u, body.getNamespaceURI(p));

      SOAPElement se = body.addChildElement(s, p);
      assertNotNull("Expected an element", se);

      assertEquals("Expected 1 child element", 1, getIteratorCount(body.getChildElements()));

      SOAPElement se2 = (SOAPElement)body.getChildElements().next();
View Full Code Here

      SOAPMessage message = MessageFactory.newInstance().createMessage();
      SOAPPart sp = message.getSOAPPart();
      SOAPEnvelope envelope = sp.getEnvelope();
      SOAPBody bdy = envelope.getBody();

      SOAPElement sbe = bdy.addChildElement(new SOAPBodyElementRpc(envelope.createName("echoString", "ns1", TARGET_NAMESPACE)));
      sbe.addChildElement(envelope.createName("String_1")).addTextNode("Hello");
      sbe.addChildElement(envelope.createName("String_2")).addTextNode("world!");

      return message;
   }
View Full Code Here

      // Create a soap body from the envelope.
      SOAPBody bdy = envelope.getBody();

      // Add a soap body element
      SOAPElement sbe = bdy.addChildElement(new SOAPBodyElementRpc(envelope.createName(rpcMethodName, NS_PREFIX, TARGET_NAMESPACE)));

      // Add a some child elements
      sbe.addChildElement(envelope.createName("message")).addTextNode("Some text message");
      return msg;
   }
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.