Package org.springframework.ws.client.core

Examples of org.springframework.ws.client.core.WebServiceTemplate


            socket.close();
        }
    }

    public void testTemplate() throws Exception {
        WebServiceTemplate template = new WebServiceTemplate(messageFactory);
        template.setMessageSender(messageSender);
        template.sendSourceAndReceiveToResult("tcp://localhost", new StringSource(REQUEST),
                new StreamResult(System.out));
    }
View Full Code Here


    private MockWebServiceServer server;

    @Before
    public void setUp() throws Exception {
        template = new WebServiceTemplate();
        template.setDefaultUri("http://example.com");

        server = MockWebServiceServer.createServer(template);
    }
View Full Code Here

        server = MockWebServiceServer.createServer(template);
    }

    @Test
    public void createServerWebServiceTemplate() throws Exception {
        WebServiceTemplate template = new WebServiceTemplate();

        MockWebServiceServer server = MockWebServiceServer.createServer(template);
        assertNotNull(server);
    }
View Full Code Here

     * @throws IllegalArgumentException if the given application context contains neither a {@link WebServiceTemplate}
     *                                  nor a {@link WebServiceGatewaySupport}.
     */
    public static MockWebServiceServer createServer(ApplicationContext applicationContext) {
        MockStrategiesHelper strategiesHelper = new MockStrategiesHelper(applicationContext);
        WebServiceTemplate webServiceTemplate = strategiesHelper.getStrategy(WebServiceTemplate.class);
        if (webServiceTemplate != null) {
            return createServer(webServiceTemplate);
        }
        WebServiceGatewaySupport gatewaySupport = strategiesHelper.getStrategy(WebServiceGatewaySupport.class);
        if (gatewaySupport != null) {
View Full Code Here

    /**
     * Creates a new instance of the {@code WebServiceGatewaySupport} class, with a default
     * {@code WebServiceTemplate}.
     */
    protected WebServiceGatewaySupport() {
        webServiceTemplate = new WebServiceTemplate();
    }
View Full Code Here

     * Creates a new {@code WebServiceGatewaySupport} instance based on the given message factory.
     *
     * @param messageFactory the message factory to use
     */
    protected WebServiceGatewaySupport(WebServiceMessageFactory messageFactory) {
        webServiceTemplate = new WebServiceTemplate(messageFactory);
    }
View Full Code Here

            URI webServiceEndpointUri = new URI(UnsafeUriCharactersEncoder.encode(remaining));

            // Obtain a WebServiceTemplate from the registry when specified by
            // an option on the component, else create a new template with
            // Spring-WS defaults
            WebServiceTemplate webServiceTemplate = resolveAndRemoveReferenceParameter(parameters,
                    "webServiceTemplate", WebServiceTemplate.class, new WebServiceTemplate());
            WebServiceMessageSender messageSender = resolveAndRemoveReferenceParameter(parameters,
                    "messageSender", WebServiceMessageSender.class, null);
            WebServiceMessageFactory messageFactory = resolveAndRemoveReferenceParameter(parameters,
                    "messageFactory", WebServiceMessageFactory.class, null);

            if (webServiceTemplate.getDefaultUri() == null) {
                webServiceTemplate.setDefaultUri(webServiceEndpointUri.toString());
            }
            if (messageSender != null) {
                webServiceTemplate.setMessageSender(messageSender);
            }
            if (messageFactory != null) {
                webServiceTemplate.setMessageFactory(messageFactory);
            }
            configuration.setWebServiceTemplate(webServiceTemplate);
        }
    }
View Full Code Here

        // Skip this whole thing if none of the relevant config options are set.
        if (!(configuration.getTimeout() > -1) && configuration.getSslContextParameters() == null) {
            return;
        }

        WebServiceTemplate webServiceTemplate = configuration.getWebServiceTemplate();

        WebServiceMessageSender[] messageSenders = webServiceTemplate.getMessageSenders();
       
        for (int i = 0; i < messageSenders.length; i++) {
            WebServiceMessageSender messageSender = messageSenders[i];
            if (messageSender instanceof CommonsHttpMessageSender) {
                if (configuration.getSslContextParameters() != null) {
View Full Code Here

            URI webServiceEndpointUri = new URI(UnsafeUriCharactersEncoder.encode(remaining));

            // Obtain a WebServiceTemplate from the registry when specified by
            // an option on the component, else create a new template with
            // Spring-WS defaults
            WebServiceTemplate webServiceTemplate = resolveAndRemoveReferenceParameter(parameters,
                    "webServiceTemplate", WebServiceTemplate.class, new WebServiceTemplate());
            WebServiceMessageSender messageSender = resolveAndRemoveReferenceParameter(parameters,
                    "messageSender", WebServiceMessageSender.class, null);
            WebServiceMessageFactory messageFactory = resolveAndRemoveReferenceParameter(parameters,
                    "messageFactory", WebServiceMessageFactory.class, null);

            if (webServiceTemplate.getDefaultUri() == null) {
                webServiceTemplate.setDefaultUri(webServiceEndpointUri.toString());
            }
            if (messageSender != null) {
                webServiceTemplate.setMessageSender(messageSender);
            }
            if (messageFactory != null) {
                webServiceTemplate.setMessageFactory(messageFactory);
            }
            configuration.setWebServiceTemplate(webServiceTemplate);
        }
    }
View Full Code Here

            URI webServiceEndpointUri = new URI(UnsafeUriCharactersEncoder.encode(remaining));

            // Obtain a WebServiceTemplate from the registry when specified by
            // an option on the component, else create a new template with
            // Spring-WS defaults
            WebServiceTemplate webServiceTemplate = resolveAndRemoveReferenceParameter(parameters,
                    "webServiceTemplate", WebServiceTemplate.class, new WebServiceTemplate());
            WebServiceMessageSender messageSender = resolveAndRemoveReferenceParameter(parameters,
                    "messageSender", WebServiceMessageSender.class, null);
            WebServiceMessageFactory messageFactory = resolveAndRemoveReferenceParameter(parameters,
                    "messageFactory", WebServiceMessageFactory.class, null);

            if (webServiceTemplate.getDefaultUri() == null) {
                webServiceTemplate.setDefaultUri(webServiceEndpointUri.toString());
            }
            if (messageSender != null) {
                webServiceTemplate.setMessageSender(messageSender);
            }
            if (messageFactory != null) {
                webServiceTemplate.setMessageFactory(messageFactory);
            }
            configuration.setWebServiceTemplate(webServiceTemplate);
        }
    }
View Full Code Here

TOP

Related Classes of org.springframework.ws.client.core.WebServiceTemplate

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.