Package org.springframework.ws.soap.addressing.client

Examples of org.springframework.ws.soap.addressing.client.ActionCallback


    }

    @Test
    public void testWSAddressingToResponseActions() throws Exception {
        StreamSource source = new StreamSource(new StringReader(xmlBody));
        webServiceTemplate.sendSourceAndReceive(source, new ActionCallback(new URI("http://doesn-not-matter.com"), new Addressing10(), new URI("http://urlOutputAndFault2.to")),
                                                TestUtil.NOOP_SOURCE_EXTRACTOR);
        resultOutputAndFault2.expectedMinimumMessageCount(1);
        resultOutputAndFault2.assertIsSatisfied();
    }
View Full Code Here


    }

    @Test(expected = WebServiceIOException.class)
    public void testWrongWSAddressingAction() throws Exception {
        StreamSource source = new StreamSource(new StringReader(xmlBody));
        webServiceTemplate.sendSourceAndReceive(source, new ActionCallback("http://this-is-a-wrong-ws-addressing-action"), TestUtil.NOOP_SOURCE_EXTRACTOR);
        resultEndpointAction.assertIsSatisfied();
    }
View Full Code Here

                SoapHeader header = ((SoapMessage) message).getSoapHeader();
                XML_CONVERTER.toResult(soapHeaderSource, header.getResult());
            }

            if (wsAddressingAction != null) {
                ActionCallback actionCallback = new ActionCallback(wsAddressingAction);
                if (wsReplyTo != null) {
                    actionCallback.setReplyTo(new EndpointReference(wsReplyTo));
                }

                if (wsFaultTo != null) {
                    actionCallback.setFaultTo(new EndpointReference(wsFaultTo));
                }
                actionCallback.doWithMessage(message);
            }

            configuration.getMessageFilter().filterProducer(exchange, message);
        }
View Full Code Here

     * @return
     * @throws URISyntaxException
     */
    protected final ActionCallback actionAndReplyTo(String action, String replyTo) throws URISyntaxException {
        requestInputAction = action;
        ActionCallback requestCallback = new ActionCallback(action);
        if (replyTo != null) {
            requestCallback.setReplyTo(new EndpointReference(new URI(replyTo)));
        }
        return requestCallback;
    }
View Full Code Here

     * @return
     * @throws URISyntaxException
     */
    protected final ActionCallback toAndReplyTo(String to, String replyTo) throws URISyntaxException {
        requestInputAction = "http://doesn-not-matter.com";
        ActionCallback requestCallback = new ActionCallback(new URI(requestInputAction), new Addressing10(), new URI(to));
        if (replyTo != null) {
            requestCallback.setReplyTo(new EndpointReference(new URI(replyTo)));
        }
        return requestCallback;
    }
View Full Code Here

            // Add WS-Addressing Action to webservice request (the WS-Addressing
            // 'to' header will default to the URL of the connection).
            // Note that exchange header takes precedence over endpoint option
            URI wsAddressingAction = wsAddressingActionHeader != null ? wsAddressingActionHeader : endpoint.getConfiguration().getWsAddressingAction();
            if (wsAddressingAction != null) {
                new ActionCallback(wsAddressingAction).doWithMessage(message);
            }
        }
View Full Code Here

        return newChannelParams();
    }

    @Test
    public void endpointSender() throws Exception {
        ActionCallback requestCallback = channelIn("http://sender-default.com");

        webServiceTemplate.sendSourceAndReceiveToResult(source, requestCallback, result);

        Assertions.assertThat(channelOut().getTo()).isEqualTo(new URI("mailto:andrej@chocolatejar.eu"));
        Assertions.assertThat(endpointCamelDirect.getReceivedCounter()).isZero();
View Full Code Here

        Assertions.assertThat(endpointCamelDirect.getReceivedCounter()).isZero();
    }

    @Test
    public void customSender() throws Exception {
        ActionCallback requestCallback = channelIn("http://sender-custom.com");

        webServiceTemplate.sendSourceAndReceiveToResult(source, requestCallback, result);

        Assertions.assertThat(customChannelParams().getTo()).isEqualTo(new URI("mailto:andrej@chocolatejar.eu"));
        Assertions.assertThat(endpointCamelDirect.getReceivedCounter()).isZero();
View Full Code Here

        Assertions.assertThat(endpointCamelDirect.getReceivedCounter()).isZero();
    }

    @Test
    public void camelInvalid() throws Exception {
        ActionCallback requestCallback = toAndReplyTo("http://sender-camel.com", "mailto:not-mappped-address@chocolatejar.eu");

        webServiceTemplate.sendSourceAndReceiveToResult(source, requestCallback, result);
        Assertions.assertThat(endpointCamelDirect.getReceivedCounter()).isZero();
    }
View Full Code Here

        Assertions.assertThat(endpointCamelDirect.getReceivedCounter()).isZero();
    }

    @Test
    public void camelReceivedReplyTo() throws Exception {
        ActionCallback requestCallback = channelIn("http://sender-camel.com");

        webServiceTemplate.sendSourceAndReceiveToResult(source, requestCallback, result);
        endpointCamelDirect.assertExchangeReceived(0);
        endpointCamelDirect.assertIsSatisfied();
    }
View Full Code Here

TOP

Related Classes of org.springframework.ws.soap.addressing.client.ActionCallback

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.