Package javax.xml.soap

Examples of javax.xml.soap.SOAPMessage.saveChanges()


                            Document doc = resp.getOwnerDocument();
                            Node info = doc.createElementNS(child.getNamespaceURI(), child.getLocalName());
                            info.setPrefix("ns4");
                            info.appendChild(doc.createTextNode(getHandlerId()));
                            resp.appendChild(info);
                            msg.saveChanges();
                        }
                    } catch (DOMException e) {
                        e.printStackTrace();
                    }
                } else {
View Full Code Here


     */
    protected SoapMessage getSoapMessageForDom(Document doc) throws SOAPException {
        SOAPMessage saajMsg = MessageFactory.newInstance().createMessage();
        SOAPPart part = saajMsg.getSOAPPart();
        part.setContent(new DOMSource(doc));
        saajMsg.saveChanges();

        SoapMessage msg = new SoapMessage(new MessageImpl());
        Exchange ex = new ExchangeImpl();
        ex.setInMessage(msg);
        msg.setContent(SOAPMessage.class, saajMsg);
View Full Code Here

           
            String trace = baos.toString("utf8");
        
            entryEle.setValue(trace);
           
            soapFault.saveChanges();

        } catch (Exception e) {
           e.printStackTrace();
        }
View Full Code Here

               // Need to saveChanges 'cos we're going to use the
               // MimeHeaders to set HTTP response information. These
               // MimeHeaders are generated as part of the save.

               if (reply.saveRequired()) {
                   reply.saveChanges();
               }

               if ( isSOAPFault (reply) ) {
                   resp.setStatus(HttpServletResponse.SC_INTERNAL_SERVER_ERROR);
               } else {
View Full Code Here

            /**
             * Add text message
             */
            element.addTextNode("Welcome to SunOne Web Services!");

            soapMessage.saveChanges();

            /**
             * Construct a default SOAP connection factory.
             */
            SOAPConnectionFactory connectionFactory = SOAPConnectionFactory.newInstance();
View Full Code Here

        /**
         *  add the attachment to the SOAP message.
         */
        soapMessage.addAttachmentPart(ap);
        soapMessage.saveChanges();

        /**
         * Convert SOAP to JMS message.
         */
        Message message = MessageTransformer.SOAPMessageIntoJMSMessage( soapMessage, session );
View Full Code Here

            responseSoapMessage.getSOAPPart().setContent(new StreamSource(new StringReader(SOAP11ResponseMessage)));
        } else if (soapVersion.equals(SOAPConstants.SOAP_1_2_PROTOCOL)) {
            responseSoapMessage.getSOAPPart().setContent(new StreamSource(new StringReader(SOAP12ResponseMessage)));
        } else
            throw new SOAPException("Unrecognized SOAP version [" + soapVersion + "]");
        responseSoapMessage.saveChanges();
        return responseSoapMessage;
    }

    public static SOAPMessage createRequestSOAPMessage(String soapVersion) throws SOAPException {
        SOAPMessage responseSoapMessage = MessageFactory.newInstance(soapVersion).createMessage();
View Full Code Here

            responseSoapMessage.getSOAPPart().setContent(new StreamSource(new StringReader(SOAP11RequestMessage)));
        } else if (soapVersion.equals(SOAPConstants.SOAP_1_2_PROTOCOL)) {
            responseSoapMessage.getSOAPPart().setContent(new StreamSource(new StringReader(SOAP12RequestMessage)));
        } else
            throw new SOAPException("Unrecognized SOAP version [" + soapVersion + "]");
        responseSoapMessage.saveChanges();
        return responseSoapMessage;
    }

    public static Source createResponseSOAPSource(String soapVersion, Service.Mode mode) throws SOAPException {
        if (mode.equals(Service.Mode.MESSAGE)) {
View Full Code Here

    public static SOAPMessage createMessage(String msg) throws SOAPException {
        Source src = new StreamSource(new StringReader(msg));
        MessageFactory factory = MessageFactory.newInstance();
        SOAPMessage message = factory.createMessage();
        message.getSOAPPart().setContent(src);
        message.saveChanges();
        return message;
    }
       
    public static Document createDocument(String xml)
        throws ParserConfigurationException, SAXException, IOException {
View Full Code Here

                                    }
                                }
                            }
                        }
                    }
                    msg.saveChanges();          
                } else {
                    SOAPMessage msg = ctx.getMessage();
                    /*
                     * System.out.println("-----------soap---------");
                     * msg.writeTo(System.out);
 
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.