Examples of SOAPBodyElement


Examples of javax.xml.soap.SOAPBodyElement

        // 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

Examples of javax.xml.soap.SOAPBodyElement

        Result result = soapMessage.getPayloadResult();
        transformer.transform(source, result);
        SOAPBody body = saajMessage.getSOAPPart().getEnvelope().getBody();
        Iterator<?> iterator = body.getChildElements();
        assertTrue("No child nodes created", iterator.hasNext());
        SOAPBodyElement bodyElement = (SOAPBodyElement) iterator.next();
        assertEquals("Invalid child node created", "child", bodyElement.getElementName().getLocalName());
    }
View Full Code Here

Examples of javax.xml.soap.SOAPBodyElement

    }

    private SaajSoapMessage createDeleteMessage() throws SOAPException {
        SOAPMessage saajMessage = messageFactory.createMessage();
        SOAPBody saajBody = saajMessage.getSOAPBody();
        SOAPBodyElement delete = saajBody.addBodyElement(new QName("http://example.com/fabrikam", "Delete"));
        SOAPElement maxCount = delete.addChildElement(new QName("maxCount"));
        maxCount.setTextContent("42");
        return new SaajSoapMessage(saajMessage);
    }
View Full Code Here

Examples of javax.xml.soap.SOAPBodyElement

                {
                    XmlObject responseBodyElem = (XmlObject) responseBodyElems.get( i );
                    SOAPBodyElement[] soapBodyElements = createSOAPBodyElements( responseBodyElem );
                    for ( int j = 0; j < soapBodyElements.length; j++ )
                    {
                        SOAPBodyElement soapBodyElement = soapBodyElements[j];
                        responseBody.addChildElement( soapBodyElement );
                    }
                }
            }
            if ( LOG.isDebugEnabled() )
View Full Code Here

Examples of javax.xml.soap.SOAPBodyElement

        SOAPBody body = envelope.getBody();

        header.detachNode();

        Name bodyName = envelope.createName("getQuote", "n", "urn:xmethods-delayed-quotes");
        SOAPBodyElement gltp = body.addBodyElement(bodyName);

        Name name = envelope.createName("symbol");
        SOAPElement symbol = gltp.addChildElement(name);
        symbol.addTextNode(tickerSymbol);

        URLEndpoint endpoint = new URLEndpoint("http://66.28.98.121:9090/soap");
        SOAPMessage response = con.call(message, endpoint);
        con.close();

        SOAPPart sp = response.getSOAPPart();
        SOAPEnvelope se = sp.getEnvelope();
        SOAPBody sb = se.getBody();
        Iterator it = sb.getChildElements();
        while (it.hasNext()) {
            SOAPBodyElement bodyElement = (SOAPBodyElement) it.next();
            Iterator it2 = bodyElement.getChildElements();
            while (it2.hasNext()) {
                SOAPElement element2 = (SOAPElement) it2.next();
                return element2.getValue();
            }
        }
View Full Code Here

Examples of javax.xml.soap.SOAPBodyElement

                messageFactory.createMessage();
        SOAPPart soapPart = soapMessage.getSOAPPart();
        SOAPEnvelope requestEnvelope =
                soapPart.getEnvelope();
        SOAPBody body = requestEnvelope.getBody();
        SOAPBodyElement operation = body.addBodyElement
                (requestEnvelope.createName("echo"));

        Vector dataHandlersToAdd = new Vector();
        dataHandlersToAdd.add(new DataHandler(new FileDataSource(new
                File(filename))));

        if (dataHandlersToAdd != null) {
            ListIterator dataHandlerIterator =
                    dataHandlersToAdd.listIterator();

            while (dataHandlerIterator.hasNext()) {
                DataHandler dataHandler = (DataHandler)
                        dataHandlerIterator.next();
                javax.xml.soap.SOAPElement element =
                        operation.addChildElement(requestEnvelope.createName("source"));
                javax.xml.soap.AttachmentPart attachment =
                        soapMessage.createAttachmentPart(dataHandler);
                soapMessage.addAttachmentPart(attachment);
                element.addAttribute(requestEnvelope.createName
                                     ("href"), "cid:" + attachment.getContentId());
View Full Code Here

Examples of javax.xml.soap.SOAPBodyElement

       
        assertEquals(sender, Basic.getHeaderValue(response, "ReceiverKey"));
        assertEquals(factory, Basic.getHeaderValue(response, "SenderKey"));
        assertEquals(id, Basic.getHeaderValue(response, "RequestID"));
       
        SOAPBodyElement processlist = Basic.getFirstBodyElement(response);
        Name answerName = processlist.getElementName();
        assertEquals(Basic.ASAP_NS, answerName.getURI());
        assertEquals("ListInstancesRs", answerName.getLocalName());
        for (Iterator processIterator = processlist.getChildElements();
            processIterator.hasNext();) {
           
            SOAPElement child = (SOAPElement) processIterator.next();
            Name childName = child.getElementName();
            assertEquals("as", childName.getPrefix());
View Full Code Here

Examples of org.apache.axis.message.SOAPBodyElement

        Call     call    = (Call) service.createCall();

        call.setTargetEndpointAddress( new URL(opts.getURL()) );
        SOAPBodyElement[] input = new SOAPBodyElement[3];

        input[0] = new SOAPBodyElement(XMLUtils.StringToElement("urn:foo",
                                                                "e1", "Hello"));
        input[1] = new SOAPBodyElement(XMLUtils.StringToElement("urn:foo",
                                                                "e1", "World"));

        DocumentBuilder builder = DocumentBuilderFactory.newInstance().newDocumentBuilder();
        Document doc            = builder.newDocument();  
        Element cdataElem       = doc.createElementNS("urn:foo", "e3");
        CDATASection cdata      = doc.createCDATASection("Text with\n\tImportant  <b>  whitespace </b> and tags! ");     
        cdataElem.appendChild(cdata);
   
        input[2] = new SOAPBodyElement(cdataElem);
       
        Vector          elems = (Vector) call.invoke( input );
        SOAPBodyElement elem  = null ;
        Element         e     = null ;

        elem = (SOAPBodyElement) elems.get(0);
        e    = elem.getAsDOM();

        String str = "Res elem[0]=" + XMLUtils.ElementToString(e);

        elem = (SOAPBodyElement) elems.get(1);
        e    = elem.getAsDOM();
        str = str + "Res elem[1]=" + XMLUtils.ElementToString(e);

        elem = (SOAPBodyElement) elems.get(2);
        e    = elem.getAsDOM();
        str = str + "Res elem[2]=" + XMLUtils.ElementToString(e);
       
        return( str );
    }
View Full Code Here

Examples of org.apache.axis.message.SOAPBodyElement

       msgContext.setHighFidelity(true);
       String request = header + request2 + footer;
       Message message = new Message(request);
       message.setMessageContext(msgContext);
       SOAPEnvelope envelope = message.getSOAPEnvelope();
       SOAPBodyElement bodyElement = (SOAPBodyElement)envelope.getBodyElements().elementAt(0);
       MessageElement me = (MessageElement) bodyElement.getChildren().get(0);
       org.xml.sax.Attributes atts = me.getCompleteAttributes();
       assertTrue(atts.getLength()==2);
    }
View Full Code Here

Examples of org.apache.axis.message.SOAPBodyElement

       assertTrue(atts.getLength()==2);
    }

    public void testEmptyNode() throws Exception
    {
        SOAPBodyElement body = new SOAPBodyElement(XMLUtils.newDocument().createElement("tmp"));
        assertEquals("<tmp/>",body.toString());
    }
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.