Package javax.xml.soap

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


    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

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

   private static void publish( String url,
                                String s )
View Full Code Here

        // lets turn the payload into a DOM Node to avoid blatting over the envelope
        DOMResult result = new DOMResult(null);
        transformer.toResult(normalizedMessage.getContent(), result);
        Document document = (Document) result.getNode();
        body.addDocument(document);

        addSoapAttachments(soapMessage, normalizedMessage);

        if (log.isDebugEnabled()) {
            ByteArrayOutputStream buffer = new ByteArrayOutputStream();
View Full Code Here

            // Create SOAP envelope.
            SOAPMessage requestMessage = soapMessageFactory.createMessage();
            SOAPEnvelope requestEnvelope = requestMessage.getSOAPPart().getEnvelope();
            SOAPBody requestBody = requestEnvelope.getBody();
            requestBody.addDocument(document);

            // Send SOAP request
            SOAPConnection connection = soapConnectionFactory.createConnection();
            SOAPMessage responseMessage = connection.call(requestMessage, stiServiceURL);
View Full Code Here

      SOAPMessage  msg      = MessageFactory.newInstance(  ).createMessage(  );
      SOAPEnvelope envelope = msg.getSOAPPart(  ).getEnvelope(  );
      SOAPBody     body     = envelope.getBody(  );

      // TODO: use SAAJ add* methods to build up SOAPBody instead of SaajUtils.toString()
      body.addDocument( JaxpUtils.toDocument( SaajUtils.toString( fullMsgBodyElem ) ) );
      SOAPHeader header = msg.getSOAPHeader(  );
      addWSAHeaders( header, epr );

      return msg;
   }
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

         }

         log.info(DOMWriter.printNode(node, false));
        
         // Add document back as removed by call to 'extractContentAsDocument()'
         body.addDocument(document);
         message.saveChanges();        
      }
      catch (SOAPException e)
      {
         throw new WSException("Error in Handler", e);
View Full Code Here

   {
      SOAPMessage  soapRequestMsg = MessageFactory.newInstance(  ).createMessage(  );
      SOAPEnvelope envelope = soapRequestMsg.getSOAPPart(  ).getEnvelope(  );

      SOAPBody     body = envelope.getBody(  );
      body.addDocument( JaxpUtils.toDocument( request.toString(  ) ) );
      SOAPHeader header = soapRequestMsg.getSOAPHeader(  );
      addWSAHeaders( header,
                     endpointUrl.toString(  ) );

      SOAPConnection soapConn        = SOAPConnectionFactory.newInstance(  ).createConnection(  );
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

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.