Package javax.xml.soap

Examples of javax.xml.soap.SOAPBody


                    System.out.println("3: \t\t" + soapH.getNodeName() + "> " + soapH.getValue());
                  }
                }
              }
              if (obj instanceof SOAPBody) {
                SOAPBody soapBody = (SOAPBody) obj;
                Iterator it4 = soapBody.getChildElements();
                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();
View Full Code Here


                }

                if (outbound) {
                    try {
                        // append handler id to SOAP response message
                        SOAPBody body = msg.getSOAPBody();
                        Node resp = body.getFirstChild();

                        if (resp.getNodeName().contains("pingResponse")) {
                            Node child = resp.getFirstChild();
                            Document doc = resp.getOwnerDocument();
                            Node info = doc.createElementNS(child.getNamespaceURI(), child.getLocalName());
View Full Code Here

        }

        boolean ret = true;
        try {
            SOAPMessage msg  = ctx.getMessage();
            SOAPBody body = msg.getSOAPBody();

            if (body.getFirstChild().getFirstChild() == null) {
                return true;
            }

            Node commandNode = body.getFirstChild().getFirstChild().getFirstChild();
            String arg = commandNode.getNodeValue();
            String namespace = body.getFirstChild().getFirstChild().getNamespaceURI();
           
            StringTokenizer strtok = new StringTokenizer(arg, " ");
            String hid = strtok.nextToken();
            String direction = strtok.nextToken();
            String command = strtok.nextToken();
           
            if (getHandlerId().equals(hid)
                && "inbound".equals(direction)) {
                if ("stop".equals(command)) {

                    // remove the incoming request body.
                    Document doc = body.getOwnerDocument();
                    // build the SOAP response for this message
                    //
                    Node wrapper = doc.createElementNS(namespace, "pingResponse");
                    wrapper.setPrefix("ns4");
                    body.removeChild(body.getFirstChild());
                    body.appendChild(wrapper);

                    for (String info : getHandlerInfoList(ctx)) {
                        // copy the the previously invoked handler list into the response. 
                        // Ignore this handlers information as it will be added again later.
                        //
View Full Code Here

               && Names.WSA_ANONYMOUS_ADDRESS.equals(maps.getTo().getValue());
    }
   
    private boolean isIncomingPartialResponse(SOAPMessageContext context)
        throws SOAPException {
        SOAPBody body =
            context.getMessage().getSOAPPart().getEnvelope().getBody();
        return !ContextUtils.isOutbound(context)
               && ContextUtils.isRequestor(context)
               && !body.getChildElements().hasNext();
    }
View Full Code Here

        callback = cb;
    }

    public Object read(int idx, T input) {
        Source obj = null;       
        SOAPBody src = (SOAPBody)input;   
        try {
            Document doc = src.extractContentAsDocument();
            assert doc != null;
   
            if (DOMSource.class.isAssignableFrom(callback.getSupportedFormats()[0])) {
                obj = new DOMSource();
                ((DOMSource)obj).setNode(doc);         
View Full Code Here

    public DOMSource invoke(DOMSource request) {
        DOMSource response = new DOMSource();
        try {
            SOAPMessage msg = factory.createMessage();           
            SOAPBody body = msg.getSOAPBody();
            body.addDocument((Document)request.getNode());

            Node n = getElementChildNode(body);
            if (n.getLocalName().equals(sayHi.getLocalPart())) {
                response.setNode(sayHiResponse.getSOAPBody().extractContentAsDocument());
            } else if (n.getLocalName().equals(greetMe.getLocalPart())) {
View Full Code Here

    public SAXSource invoke(SAXSource request) {
        SAXSource response = new SAXSource();
        try {
            SOAPMessage msg = factory.createMessage();
            msg.getSOAPPart().setContent(request);
            SOAPBody body = msg.getSOAPBody();
            Node n = body.getFirstChild();

            while (n.getNodeType() != Node.ELEMENT_NODE) {
                n = n.getNextSibling();
            }
            if (n.getLocalName().equals(sayHi.getLocalPart())) {
View Full Code Here

    public StreamSource invoke(StreamSource request) {
        StreamSource response = new StreamSource();
        try {
            SOAPMessage msg = factory.createMessage();
            msg.getSOAPPart().setContent(request);
            SOAPBody body = msg.getSOAPBody();
            Node n = body.getFirstChild();

            while (n.getNodeType() != Node.ELEMENT_NODE) {
                n = n.getNextSibling();
            }
            if (n.getLocalName().equals(sayHi.getLocalPart())) {
View Full Code Here

        TestDynamicDataBindingCallback callback = 
            new TestDynamicDataBindingCallback(DOMSource.class, Mode.PAYLOAD);       
        TestSOAPBodyDataWriter<SOAPBody> soapBodyDataWriter = new TestSOAPBodyDataWriter<SOAPBody>(callback);
        obj = domSource;
        soapBodyDataWriter.write(obj, soapMsg.getSOAPBody());
        SOAPBody soapBody = soapBodyDataWriter.getTestSOAPBody();
        assertTrue("TextContent should be TestSOAPInputMessage",
                   "TestSOAPInputMessage".equals(soapBody.getFirstChild().getTextContent()));
       
    }
View Full Code Here

        TestDynamicDataBindingCallback callback = 
            new TestDynamicDataBindingCallback(SAXSource.class, Mode.PAYLOAD);       
        TestSOAPBodyDataWriter<SOAPBody> soapBodyDataWriter = new TestSOAPBodyDataWriter<SOAPBody>(callback);
        obj = saxSource;
        soapBodyDataWriter.write(obj, soapMsg.getSOAPBody());
        SOAPBody soapBody = soapBodyDataWriter.getTestSOAPBody();
        assertTrue("TextContent should be TestSOAPInputMessage",
                   "TestSOAPInputMessage".equals(soapBody.getFirstChild().getTextContent()));
     
    }
View Full Code Here

TOP

Related Classes of javax.xml.soap.SOAPBody

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.