Package javax.xml.soap

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


            message.getSOAPHeader().detachNode();
            // assertNull(message.getSOAPHeader());   
            // TODO:this fails. Header is always being created if it doesnt exist in DOOM

            SOAPBody soapBody = message.getSOAPBody();
            soapBody.addDocument(document);
            message.saveChanges();

            // Get contents using SAAJ APIs
            Iterator iter1 = soapBody.getChildElements();
            getContents(iter1, "");
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

            throws Exception
    {
        SOAPMessage msg = MessageFactory.newInstance().createMessage();
        SOAPEnvelope envelope = msg.getSOAPPart().getEnvelope();
        SOAPBody body = envelope.getBody();
        body.addDocument( fullMsgBodyElem );
        SOAPHeader header = msg.getSOAPHeader();
        addWSAHeaders( header, consumerEPR );
        return msg;
    }
}
View Full Code Here

        SOAPHeader soapHeader = soapMsg.getSOAPHeader();
        //TODO !!! set the wsa headers

        SOAPBody soapBody = soapMsg.getSOAPBody();
        //TODO doubt this will work...but lets give it a try using a Document type "notifyDoc"
        soapBody.addDocument(dom);
        return soapMsg;
    }
   
    public void publish(Object msg, org.apache.ws.notification.topics.Topic t) {
        try{
View Full Code Here

            message.getSOAPHeader().detachNode();
            // assertNull(message.getSOAPHeader());   
            // TODO:this fails. Header is always being created if it doesnt exist in DOOM

            SOAPBody soapBody = message.getSOAPBody();
            soapBody.addDocument(document);
            message.saveChanges();

            // Get contents using SAAJ APIs
            Iterator iter1 = soapBody.getChildElements();
            getContents(iter1, "");
View Full Code Here

            message.getSOAPHeader().detachNode();
            // assertNull(message.getSOAPHeader());   
            // TODO:this fails. Header is always being created if it doesnt exist in DOOM

            SOAPBody soapBody = message.getSOAPBody();
            soapBody.addDocument(document);
            message.saveChanges();

            // Get contents using SAAJ APIs
            Iterator iter1 = soapBody.getChildElements();
            getContents(iter1, "");
View Full Code Here

        // Do not use DOMResult to transform as namespaces are lost (why ?)
        //DOMResult result = new DOMResult(null);
        //transformer.toResult(normalizedMessage.getContent(), result);
        //Document document = (Document) result.getNode();
        Document document = transformer.toDOMDocument(normalizedMessage);
        body.addDocument(document);

        addSoapAttachments(soapMessage, normalizedMessage);

        return soapMessage;
    }
View Full Code Here

        MessageFactory factory = new org.apache.axis.soap.MessageFactoryImpl();
        SOAPMessage msg = factory.createMessage();
        msg.getSOAPBody();
        SOAPBody body = msg.getSOAPBody();
       
        SOAPBodyElement soapBodyElt = body.addDocument(document);
        assertXMLEqual(xml, soapBodyElt.toString());
    }

    private String messageToString(SOAPMessage message) throws Exception {
        ByteArrayOutputStream baos = new ByteArrayOutputStream(1024);
View Full Code Here

         SOAPMessage resMessage = msgFactory.createMessage();
         SOAPBody soapBody = resMessage.getSOAPBody();

         DocumentBuilder builder = getDocumentBuilder();
         Document doc = builder.parse(new ByteArrayInputStream(Message.response.getBytes()));
         soapBody.addDocument(doc);

         SOAPElement resElement = (SOAPElement)soapBody.getChildElements().next();
         return resElement;
      }
      catch (RuntimeException e)
View Full Code Here

        MessageFactory factory = new org.apache.axis.soap.MessageFactoryImpl();
        SOAPMessage msg = factory.createMessage();
        msg.getSOAPBody();
        SOAPBody body = msg.getSOAPBody();
       
        SOAPBodyElement soapBodyElt = body.addDocument(document);
        assertXMLEqual(xml, soapBodyElt.toString());
    }

    public void testForParent() throws Exception {
      String NL =  System.getProperty("line.separator");
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.