Package org.apache.soap.transport

Examples of org.apache.soap.transport.TransportMessage


                                                        EnvelopeEditor editor,
                                                        SOAPContext ctx)
        throws SOAPException, IOException,
        IllegalArgumentException, MessagingException {
        // Read input stream.
        TransportMessage reqMsg = new TransportMessage(is, contentLength,
                                                       contentType, ctx,
                                                       null);
        // Extract envelope and SOAPContext
        reqMsg.read();
        // Check Content-Type of root part of request to see if it's
        // consistent with a SOAP envelope (text/xml).
        MimeBodyPart rootPart = ctx.getRootPart();
        if (!rootPart.isMimeType(Constants.HEADERVAL_CONTENT_TYPE))
            throw new SOAPException(Constants.FAULT_CODE_PROTOCOL,
                "Unsupported content type \"" +
                rootPart.getContentType() + "\", must be: \"" +
                Constants.HEADERVAL_CONTENT_TYPE + "\".");
        // Apply Transport-Hook-Extension
        reqMsg.editIncoming(editor);
        // Parse into Envelope.
        return reqMsg.unmarshall(xdb);
    }
View Full Code Here


                String body = ((TextMessage) msg).getText();
                if (body != null) {
                    if (verbose)
                        System.out.println("Message contained '" + body + "'");

                    TransportMessage tmsg =
                        new TransportMessage(body, new SOAPContext(), new Hashtable());
                    setOutGoingHeaders(msg, tmsg);
                    tmsg.save();

                    TransportMessage response = HTTPUtils.post(getServiceURL(msg), tmsg, 30000, null, 0);
                    payload = IOUtils.getStringFromReader(response.getEnvelopeReader());
                    if (verbose)
                        System.out.println("HTTP RESPONSE IS: '" + payload + "'");
                } else {
                    System.err.println("error: message contained no body");
                    payload = "error: message contained no body";
View Full Code Here

                                                        EnvelopeEditor editor,
                                                        SOAPContext ctx)
        throws SOAPException, IOException,
        IllegalArgumentException, MessagingException {
        // Read input stream.
        TransportMessage reqMsg = new TransportMessage(is, contentLength,
                                                       contentType, ctx,
                                                       null);
        // Extract envelope and SOAPContext
        reqMsg.read();
        // Check Content-Type of root part of request to see if it's
        // consistent with a SOAP envelope (text/xml).
        MimeBodyPart rootPart = ctx.getRootPart();
        if (!rootPart.isMimeType(Constants.HEADERVAL_CONTENT_TYPE))
            throw new SOAPException(Constants.FAULT_CODE_PROTOCOL,
                "Unsupported content type \"" +
                rootPart.getContentType() + "\", must be: \"" +
                Constants.HEADERVAL_CONTENT_TYPE + "\".");
        // Apply Transport-Hook-Extension
        reqMsg.editIncoming(editor);
        // Parse into Envelope.
        return reqMsg.unmarshall(xpl);
    }
View Full Code Here

TOP

Related Classes of org.apache.soap.transport.TransportMessage

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.