Package org.springframework.ws

Examples of org.springframework.ws.WebServiceMessage


            streamWriter.writeStartElement(prefix, localName, namespaceURI);
        }

        private void createStreamWriter() throws XMLStreamException {
            if (streamWriter == null) {
                WebServiceMessage response = messageContext.getResponse();
                streamWriter = getStreamWriter(response.getPayloadResult());
                if (streamWriter == null) {
                    // as a final resort, use a stream, and transform that at endDocument()
                    os = new ByteArrayOutputStream();
                    streamWriter = getOutputFactory().createXMLStreamWriter(os);
                }
View Full Code Here


        else if (receivedMessageTracingLogger.isDebugEnabled()) {
            receivedMessageTracingLogger.debug("Received request [" + messageContext.getRequest() + "]");
        }
        dispatch(messageContext);
        if (messageContext.hasResponse()) {
            WebServiceMessage response = messageContext.getResponse();
            if (sentMessageTracingLogger.isTraceEnabled()) {
                String responseContent = getMessageContent(response);
                sentMessageTracingLogger.trace("Sent response [" + responseContent + "] for request [" +
                                requestContent + "]");
            }
View Full Code Here

                                       int interceptorIndex,
                                       MessageContext messageContext) throws Exception {
        if (mappedEndpoint != null && messageContext.hasResponse() &&
                !ObjectUtils.isEmpty(mappedEndpoint.getInterceptors())) {
            boolean hasFault = false;
            WebServiceMessage response = messageContext.getResponse();
            if (response instanceof FaultAwareWebServiceMessage) {
                hasFault = ((FaultAwareWebServiceMessage) response).hasFault();
            }
            boolean resume = true;
            for (int i = interceptorIndex; resume && i >= 0; i--) {
View Full Code Here

    private void invokeSourceProvider(MessageContext messageContext, Provider<Source> provider)
            throws TransformerException {
        Source requestSource = messageContext.getRequest().getPayloadSource();
        Source responseSource = provider.invoke(requestSource);
        if (responseSource != null) {
            WebServiceMessage response = messageContext.getResponse();
            Transformer transformer = createTransformer();
            transformer.transform(responseSource, response.getPayloadResult());
        }
    }
View Full Code Here

        String xml = "<soapenv:Envelope xmlns:soapenv='http://schemas.xmlsoap.org/soap/envelope/'><soapenv:Body>" +
                "<root xmlns='http://springframework.org/spring-ws'><child /></root>" +
                "</soapenv:Body></soapenv:Envelope>";
        TransportInputStream tis = new MockTransportInputStream(new ByteArrayInputStream(xml.getBytes()));
        WebServiceMessage message = messageFactory.createWebServiceMessage(tis);

        StringResult result = new StringResult();
        transformer.transform(message.getPayloadSource(), result);
        transformer.transform(message.getPayloadSource(), result);
    }
View Full Code Here

        String xml = "<soapenv:Envelope xmlns:soapenv='http://schemas.xmlsoap.org/soap/envelope/'><soapenv:Body>" +
                "<root xmlns='http://springframework.org/spring-ws'><child /></root>" +
                "</soapenv:Body></soapenv:Envelope>";
        TransportInputStream tis = new MockTransportInputStream(new ByteArrayInputStream(xml.getBytes()));
        WebServiceMessage message = messageFactory.createWebServiceMessage(tis);

        StringResult result = new StringResult();
        transformer.transform(message.getPayloadSource(), result);
        try {
            transformer.transform(message.getPayloadSource(), result);
            fail("TransformerException expected");
        }
        catch (TransformerException expected) {
            // ignore
        }
View Full Code Here

public abstract class AbstractSoapMessageFactoryTestCase extends AbstractWebServiceMessageFactoryTestCase {

    @Test
    public void testCreateEmptySoapMessage() throws Exception {
        WebServiceMessage message = messageFactory.createWebServiceMessage();
        assertTrue("Not a SoapMessage", message instanceof SoapMessage);
    }
View Full Code Here

*/
public abstract class AbstractMessageCreator implements WebServiceMessageCreator {

    @Override
    public final WebServiceMessage createMessage(WebServiceMessageFactory messageFactory) throws IOException {
        WebServiceMessage message = messageFactory.createWebServiceMessage();
        doWithMessage(message);
        return message;
    }
View Full Code Here

    @Override
    public final WebServiceMessage createResponse(URI uri,
                                                  WebServiceMessage request,
                                                  WebServiceMessageFactory messageFactory) throws IOException {
        WebServiceMessage response = messageFactory.createWebServiceMessage();
        doWithResponse(uri, request, response);
        return response;
    }
View Full Code Here

     * @see RequestCreators
     */
    public ResponseActions sendRequest(RequestCreator requestCreator) {
        Assert.notNull(requestCreator, "'requestCreator' must not be null");
        try {
            WebServiceMessage request = requestCreator.createRequest(messageFactory);
            MessageContext messageContext = new DefaultMessageContext(request, messageFactory);

            messageReceiver.receive(messageContext);

            return new MockWebServiceClientResponseActions(messageContext);
View Full Code Here

TOP

Related Classes of org.springframework.ws.WebServiceMessage

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.