Package javax.xml.soap

Examples of javax.xml.soap.SOAPBodyElement


                if (it4 != null) {
                  while (it4.hasNext()) {
                    System.out.println("4: \t" + soapBody.getNodeName());
                    Object obj4 = it4.next();
                    if (obj4 instanceof SOAPBodyElement) {
                      SOAPBodyElement soapBodyElement = (SOAPBodyElement) obj4;
                      System.out.println("5: \t" + soapBodyElement.getNodeName());
                      Iterator it5 = soapBodyElement.getChildElements();
                      NodeList nl =  soapBodyElement.getChildNodes();
                      if (nl != null) {
                        for (int i = 0; i < nl.getLength(); i++) {
                          System.out.println("6: \t\t" + nl.item(i).getNodeName());
                        }
                      }
View Full Code Here


        Result result = new SAXResult(handler);
        transformer.transform(source, result);
        Name rootName = envelope.createName("Root", "", "http://springframework.org/spring-ws/1");
        Iterator<?> iterator = envelope.getBody().getChildElements(rootName);
        Assert.assertTrue("No child found", iterator.hasNext());
        SOAPBodyElement rootElement = (SOAPBodyElement) iterator.next();
        Name childName = envelope.createName("Child", "child", "http://springframework.org/spring-ws/2");
        iterator = rootElement.getChildElements(childName);
        Assert.assertTrue("No child found", iterator.hasNext());
        SOAPElement childElement = (SOAPElement) iterator.next();
        Assert.assertEquals("Invalid contents", "Content", childElement.getValue());
        Name attributeName = envelope.createName("attribute");
        Assert.assertEquals("Invalid attribute value", "value", childElement.getAttributeValue(attributeName));
View Full Code Here

        SOAPMessage resultedMessage = message.getContent(SOAPMessage.class);
        assertNotNull(resultedMessage);
        SOAPBody bodyNew = resultedMessage.getSOAPBody();
        Iterator itNew = bodyNew.getChildElements(new QName("http://apache.org/hello_world_rpclit",
                                                            "sendReceiveDataResponse"));
        SOAPBodyElement bodyElementNew = (SOAPBodyElement)itNew.next();
        Iterator outIt = bodyElementNew
            .getChildElements(new QName("http://apache.org/hello_world_rpclit/types", "out"));
        Element outElement = (SOAPElement)outIt.next();
        assertNotNull(outElement);       
        Element elem3Element =
            DOMUtils.findAllElementsByTagNameNS(outElement,
View Full Code Here

        // Verify SOAPMessage
        SOAPMessage soapMessageNew = message.getContent(SOAPMessage.class);
        SOAPBody bodyNew = soapMessageNew.getSOAPBody();
        Iterator itNew = bodyNew.getChildElements();
        SOAPBodyElement bodyElementNew = (SOAPBodyElement)itNew.next();
        assertEquals("sendReceiveData", bodyElementNew.getLocalName());

        // Verify the XMLStreamReader
        XMLStreamReader xmlReader = message.getContent(XMLStreamReader.class);
        QName qn = xmlReader.getName();
        assertEquals("sendReceiveData", qn.getLocalPart());
View Full Code Here

       SOAPPart soapPart = message.getSOAPPart();
       SOAPBody soapBody = soapPart.getEnvelope().getBody();
       //Create the outer body element
       String uddins = IRegistry.UDDI_V2_NAMESPACE;
       Name bodyName = factory.createName(elem.getNodeName(), prefix, uddins);
       SOAPBodyElement bodyElement = soapBody.addBodyElement(bodyName);
       bodyElement.addNamespaceDeclaration(prefix,uddins);     
       appendAttributes(bodyElement, elem.getAttributes(), factory);
       appendElements(bodyElement,elem.getChildNodes(), factory);
       return message;
    }
View Full Code Here

       SOAPPart soapPart = message.getSOAPPart();
       SOAPBody soapBody = soapPart.getEnvelope().getBody();
       //Create the outer body element
       String uddins = IRegistry.UDDI_V2_NAMESPACE;
       Name bodyName = factory.createName(elem.getNodeName(),prefix,uddins);
       SOAPBodyElement bodyElement = soapBody.addBodyElement(bodyName);
       bodyElement.addNamespaceDeclaration(prefix,uddins);     
       appendAttributes(bodyElement, elem.getAttributes(), factory);
       appendElements(bodyElement,elem.getChildNodes(), factory);
       return message;
    }
View Full Code Here

       SOAPPart soapPart = message.getSOAPPart();
       SOAPBody soapBody = soapPart.getEnvelope().getBody();
       //Create the outer body element
       String uddins = IRegistry.UDDI_V2_NAMESPACE;
       Name bodyName = factory.createName(elem.getNodeName(),prefix,uddins);
       SOAPBodyElement bodyElement = soapBody.addBodyElement(bodyName);
       bodyElement.addNamespaceDeclaration(prefix,uddins);     
       appendAttributes(bodyElement, elem.getAttributes(), factory);
       appendElements(bodyElement,elem.getChildNodes(), factory);
       return message;
    }
View Full Code Here

                                           "executeResponse",
                                           "ns1" );
            QName responseName = new QName( "http://soap.jax.drools.org/",
                                            "return",
                                            "ns1" );
            SOAPBodyElement payload = body.addBodyElement( payloadName );
            SOAPElement response = payload.addChildElement( responseName );
            //Bad Hack - Need to remote it and fix it in Camel (if it's a camel problem)
            // response.addTextNode( StringUtils.toString( is ) );
            response.addTextNode( results );
            exchange.getOut().setBody( soapMessage );
        }
View Full Code Here

                                       "executeResponse",
                                       "ns1" );
        QName responseName = new QName( "http://soap.jax.drools.org/",
                                        "return",
                                        "ns1" );
        SOAPBodyElement payload = soapBody.addBodyElement( payloadName );
        SOAPElement response = payload.addChildElement( responseName );
        response.addTextNode( StringUtils.toString( bais ) );

        ByteArrayOutputStream baos = new ByteArrayOutputStream();
        soapMessage.writeTo( baos );
View Full Code Here

        SOAPMessage resultedMessage = message.getContent(SOAPMessage.class);
        assertNotNull(resultedMessage);
        SOAPBody bodyNew = resultedMessage.getSOAPBody();
        Iterator itNew = bodyNew.getChildElements(new QName("http://apache.org/hello_world_rpclit",
                                                            "sendReceiveDataResponse"));
        SOAPBodyElement bodyElementNew = (SOAPBodyElement)itNew.next();
        Iterator outIt = bodyElementNew
            .getChildElements(new QName("http://apache.org/hello_world_rpclit/types", "out"));
        Element outElement = (SOAPElement)outIt.next();
        assertNotNull(outElement);       
        Element elem3Element =
            DOMUtils.findAllElementsByTagNameNS(outElement,
View Full Code Here

TOP

Related Classes of javax.xml.soap.SOAPBodyElement

Copyright © 2018 www.massapicom. 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.