Browse Source

Create spring-boot-webservices module

Closes gh-46125
pull/46230/head
Andy Wilkinson 9 months ago
parent
commit
2b42f026b8
  1. 1
      settings.gradle
  2. 141
      spring-boot-project/spring-boot-all/src/main/java/org/springframework/boot/webservices/client/HttpWebServiceMessageSenderBuilder.java
  3. 73
      spring-boot-project/spring-boot-all/src/test/java/org/springframework/boot/webservices/client/HttpWebServiceMessageSenderBuilderJettyClientIntegrationTests.java
  4. 75
      spring-boot-project/spring-boot-all/src/test/java/org/springframework/boot/webservices/client/HttpWebServiceMessageSenderBuilderReactorClientIntegrationTests.java
  5. 69
      spring-boot-project/spring-boot-all/src/test/java/org/springframework/boot/webservices/client/HttpWebServiceMessageSenderBuilderSimpleIntegrationTests.java
  6. 77
      spring-boot-project/spring-boot-all/src/test/java/org/springframework/boot/webservices/client/HttpWebServiceMessageSenderBuilderTests.java
  7. 7
      spring-boot-project/spring-boot-autoconfigure-all/build.gradle
  8. 5
      spring-boot-project/spring-boot-autoconfigure-all/src/main/resources/META-INF/additional-spring-configuration-metadata.json
  9. 2
      spring-boot-project/spring-boot-autoconfigure-all/src/main/resources/META-INF/spring/org.springframework.boot.autoconfigure.AutoConfiguration.imports
  10. 3
      spring-boot-project/spring-boot-dependencies/build.gradle
  11. 3
      spring-boot-project/spring-boot-docs/build.gradle
  12. 3
      spring-boot-project/spring-boot-starters/spring-boot-starter-web-services/build.gradle
  13. 1
      spring-boot-project/spring-boot-test-autoconfigure/build.gradle
  14. 2
      spring-boot-project/spring-boot-test-autoconfigure/src/main/java/org/springframework/boot/test/autoconfigure/webservices/client/WebServiceClientTemplateAutoConfiguration.java
  15. 2
      spring-boot-project/spring-boot-test-autoconfigure/src/main/resources/META-INF/spring/org.springframework.boot.test.autoconfigure.webservices.client.AutoConfigureWebServiceClient.imports
  16. 2
      spring-boot-project/spring-boot-test-autoconfigure/src/main/resources/META-INF/spring/org.springframework.boot.test.autoconfigure.webservices.server.AutoConfigureWebServiceServer.imports
  17. 43
      spring-boot-project/spring-boot-webservices/build.gradle
  18. 2
      spring-boot-project/spring-boot-webservices/src/main/java/org/springframework/boot/webservices/autoconfigure/OnWsdlLocationsCondition.java
  19. 2
      spring-boot-project/spring-boot-webservices/src/main/java/org/springframework/boot/webservices/autoconfigure/WebServicesAutoConfiguration.java
  20. 2
      spring-boot-project/spring-boot-webservices/src/main/java/org/springframework/boot/webservices/autoconfigure/WebServicesProperties.java
  21. 7
      spring-boot-project/spring-boot-webservices/src/main/java/org/springframework/boot/webservices/autoconfigure/client/WebServiceTemplateAutoConfiguration.java
  22. 2
      spring-boot-project/spring-boot-webservices/src/main/java/org/springframework/boot/webservices/autoconfigure/client/package-info.java
  23. 2
      spring-boot-project/spring-boot-webservices/src/main/java/org/springframework/boot/webservices/autoconfigure/package-info.java
  24. 0
      spring-boot-project/spring-boot-webservices/src/main/java/org/springframework/boot/webservices/client/WebServiceMessageSenderFactory.java
  25. 2
      spring-boot-project/spring-boot-webservices/src/main/java/org/springframework/boot/webservices/client/WebServiceTemplateBuilder.java
  26. 0
      spring-boot-project/spring-boot-webservices/src/main/java/org/springframework/boot/webservices/client/WebServiceTemplateCustomizer.java
  27. 0
      spring-boot-project/spring-boot-webservices/src/main/java/org/springframework/boot/webservices/client/package-info.java
  28. 9
      spring-boot-project/spring-boot-webservices/src/main/resources/META-INF/additional-spring-configuration-metadata.json
  29. 2
      spring-boot-project/spring-boot-webservices/src/main/resources/META-INF/spring/org.springframework.boot.autoconfigure.AutoConfiguration.imports
  30. 2
      spring-boot-project/spring-boot-webservices/src/test/java/org/springframework/boot/webservices/autoconfigure/OnWsdlLocationsConditionTests.java
  31. 2
      spring-boot-project/spring-boot-webservices/src/test/java/org/springframework/boot/webservices/autoconfigure/WebServicesAutoConfigurationTests.java
  32. 2
      spring-boot-project/spring-boot-webservices/src/test/java/org/springframework/boot/webservices/autoconfigure/WebServicesPropertiesTests.java
  33. 14
      spring-boot-project/spring-boot-webservices/src/test/java/org/springframework/boot/webservices/autoconfigure/client/WebServiceTemplateAutoConfigurationTests.java
  34. 0
      spring-boot-project/spring-boot-webservices/src/test/java/org/springframework/boot/webservices/client/WebServiceMessageSenderFactoryTests.java
  35. 0
      spring-boot-project/spring-boot-webservices/src/test/java/org/springframework/boot/webservices/client/WebServiceTemplateBuilderTests.java

1
settings.gradle

@ -137,6 +137,7 @@ include "spring-boot-project:spring-boot-tx" @@ -137,6 +137,7 @@ include "spring-boot-project:spring-boot-tx"
include "spring-boot-project:spring-boot-undertow"
include "spring-boot-project:spring-boot-validation"
include "spring-boot-project:spring-boot-webmvc"
include "spring-boot-project:spring-boot-webservices"
include "spring-boot-system-tests:spring-boot-deployment-tests"
include "spring-boot-system-tests:spring-boot-image-tests"
include "spring-boot-tests:spring-boot-integration-tests:spring-boot-configuration-processor-tests"

141
spring-boot-project/spring-boot-all/src/main/java/org/springframework/boot/webservices/client/HttpWebServiceMessageSenderBuilder.java

@ -1,141 +0,0 @@ @@ -1,141 +0,0 @@
/*
* Copyright 2012-present the original author or authors.
*
* Licensed under the Apache License, Version 2.0 (the "License");
* you may not use this file except in compliance with the License.
* You may obtain a copy of the License at
*
* https://www.apache.org/licenses/LICENSE-2.0
*
* Unless required by applicable law or agreed to in writing, software
* distributed under the License is distributed on an "AS IS" BASIS,
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
* See the License for the specific language governing permissions and
* limitations under the License.
*/
package org.springframework.boot.webservices.client;
import java.time.Duration;
import java.util.function.Function;
import java.util.function.Supplier;
import org.springframework.boot.http.client.ClientHttpRequestFactoryBuilder;
import org.springframework.boot.http.client.ClientHttpRequestFactorySettings;
import org.springframework.boot.http.client.JdkClientHttpRequestFactoryBuilder;
import org.springframework.boot.ssl.SslBundle;
import org.springframework.http.client.ClientHttpRequestFactory;
import org.springframework.util.Assert;
import org.springframework.ws.transport.WebServiceMessageSender;
/**
* {@link WebServiceMessageSender} builder that can detect a suitable HTTP library based
* on the classpath.
*
* @author Stephane Nicoll
* @since 2.1.0
* @deprecated since 3.4.0 in favor of
* {@link WebServiceMessageSenderFactory#http(ClientHttpRequestFactorySettings)}
*/
@Deprecated(since = "3.4.0", forRemoval = true)
public class HttpWebServiceMessageSenderBuilder {
private ClientHttpRequestFactoryBuilder<?> requestFactoryBuilder;
private ClientHttpRequestFactorySettings requestFactorySettings = ClientHttpRequestFactorySettings.defaults();
/**
* Set the connection timeout.
* @param connectTimeout the connection timeout
* @return the current builder instance
*/
public HttpWebServiceMessageSenderBuilder setConnectTimeout(Duration connectTimeout) {
this.requestFactorySettings = this.requestFactorySettings.withConnectTimeout(connectTimeout);
return this;
}
/**
* Set the read timeout.
* @param readTimeout the read timeout
* @return the current builder instance
*/
public HttpWebServiceMessageSenderBuilder setReadTimeout(Duration readTimeout) {
this.requestFactorySettings = this.requestFactorySettings.withReadTimeout(readTimeout);
return this;
}
/**
* Set an {@link SslBundle} that will be used to configure a secure connection.
* @param sslBundle the SSL bundle
* @return the current builder instance
*/
public HttpWebServiceMessageSenderBuilder sslBundle(SslBundle sslBundle) {
this.requestFactorySettings = this.requestFactorySettings.withSslBundle(sslBundle);
return this;
}
/**
* Set the {@code Supplier} of {@link ClientHttpRequestFactory} that should be called
* to create the HTTP-based {@link WebServiceMessageSender}.
* @param requestFactorySupplier the supplier for the request factory
* @return the current builder instance
*/
public HttpWebServiceMessageSenderBuilder requestFactory(
Supplier<ClientHttpRequestFactory> requestFactorySupplier) {
Assert.notNull(requestFactorySupplier, "'requestFactorySupplier' must not be null");
this.requestFactoryBuilder = ClientHttpRequestFactoryBuilder.of(requestFactorySupplier);
return this;
}
/**
* Set the {@code Function} of {@link ClientHttpRequestFactorySettings} to
* {@link ClientHttpRequestFactory} that should be called to create the HTTP-based
* {@link WebServiceMessageSender}.
* @param requestFactoryFunction the function for the request factory
* @return the current builder instance
* @since 3.0.0
*/
public HttpWebServiceMessageSenderBuilder requestFactory(
Function<ClientHttpRequestFactorySettings, ClientHttpRequestFactory> requestFactoryFunction) {
Assert.notNull(requestFactoryFunction, "'requestFactoryFunction' must not be null");
this.requestFactoryBuilder = requestFactoryFunction::apply;
return this;
}
/**
* Set the {@link ClientHttpRequestFactoryBuilder} to use when creating the HTTP-based
* {@link WebServiceMessageSender}.
* @param requestFactoryBuilder the {@link ClientHttpRequestFactoryBuilder} to use
* @return this builder instance
* @since 3.4.0
*/
public HttpWebServiceMessageSenderBuilder requestFactoryBuilder(
ClientHttpRequestFactoryBuilder<?> requestFactoryBuilder) {
Assert.notNull(requestFactoryBuilder, "'requestFactoryBuilder' must not be null");
this.requestFactoryBuilder = requestFactoryBuilder;
return this;
}
/**
* Build the {@link WebServiceMessageSender} instance.
* @return the {@link WebServiceMessageSender} instance
*/
public WebServiceMessageSender build() {
ClientHttpRequestFactoryBuilder<?> requestFactoryBuilder = getOrDetectRequestFactoryBuilder();
return WebServiceMessageSenderFactory.http(requestFactoryBuilder, this.requestFactorySettings)
.getWebServiceMessageSender();
}
private ClientHttpRequestFactoryBuilder<?> getOrDetectRequestFactoryBuilder() {
if (this.requestFactoryBuilder != null) {
return this.requestFactoryBuilder;
}
ClientHttpRequestFactoryBuilder<?> builder = ClientHttpRequestFactoryBuilder.detect();
if (builder instanceof JdkClientHttpRequestFactoryBuilder) {
// Same logic as earlier versions which did not support JDK client factories
return ClientHttpRequestFactoryBuilder.simple();
}
return builder;
}
}

73
spring-boot-project/spring-boot-all/src/test/java/org/springframework/boot/webservices/client/HttpWebServiceMessageSenderBuilderJettyClientIntegrationTests.java

@ -1,73 +0,0 @@ @@ -1,73 +0,0 @@
/*
* Copyright 2012-present the original author or authors.
*
* Licensed under the Apache License, Version 2.0 (the "License");
* you may not use this file except in compliance with the License.
* You may obtain a copy of the License at
*
* https://www.apache.org/licenses/LICENSE-2.0
*
* Unless required by applicable law or agreed to in writing, software
* distributed under the License is distributed on an "AS IS" BASIS,
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
* See the License for the specific language governing permissions and
* limitations under the License.
*/
package org.springframework.boot.webservices.client;
import java.time.Duration;
import org.eclipse.jetty.client.HttpClient;
import org.junit.jupiter.api.Test;
import org.springframework.boot.testsupport.classpath.ClassPathExclusions;
import org.springframework.http.client.ClientHttpRequestFactory;
import org.springframework.http.client.JettyClientHttpRequestFactory;
import org.springframework.test.util.ReflectionTestUtils;
import org.springframework.ws.transport.WebServiceMessageSender;
import org.springframework.ws.transport.http.ClientHttpRequestMessageSender;
import static org.assertj.core.api.Assertions.assertThat;
/**
* Tests for {@link HttpWebServiceMessageSenderBuilder} when Http Components is not
* available and, therefore, Jetty's client is used instead.
*
* @author Stephane Nicoll
* @deprecated since 3.4.0 for removal in 4.0.0
*/
@ClassPathExclusions("httpclient5-*.jar")
@SuppressWarnings("removal")
@Deprecated(since = "3.4.0", forRemoval = true)
class HttpWebServiceMessageSenderBuilderJettyClientIntegrationTests {
private final HttpWebServiceMessageSenderBuilder builder = new HttpWebServiceMessageSenderBuilder();
@Test
void buildUseJettyClientIfHttpComponentsIsNotAvailable() {
WebServiceMessageSender messageSender = this.builder.build();
assertJettyClientHttpRequestFactory(messageSender);
}
@Test
void buildWithCustomTimeouts() {
WebServiceMessageSender messageSender = this.builder.setConnectTimeout(Duration.ofSeconds(5))
.setReadTimeout(Duration.ofSeconds(2))
.build();
JettyClientHttpRequestFactory factory = assertJettyClientHttpRequestFactory(messageSender);
HttpClient client = (HttpClient) ReflectionTestUtils.getField(factory, "httpClient");
assertThat(client).isNotNull();
assertThat(client.getConnectTimeout()).isEqualTo(5000);
assertThat(factory).hasFieldOrPropertyWithValue("readTimeout", 2000L);
}
private JettyClientHttpRequestFactory assertJettyClientHttpRequestFactory(WebServiceMessageSender messageSender) {
assertThat(messageSender).isInstanceOf(ClientHttpRequestMessageSender.class);
ClientHttpRequestMessageSender sender = (ClientHttpRequestMessageSender) messageSender;
ClientHttpRequestFactory requestFactory = sender.getRequestFactory();
assertThat(requestFactory).isInstanceOf(JettyClientHttpRequestFactory.class);
return (JettyClientHttpRequestFactory) requestFactory;
}
}

75
spring-boot-project/spring-boot-all/src/test/java/org/springframework/boot/webservices/client/HttpWebServiceMessageSenderBuilderReactorClientIntegrationTests.java

@ -1,75 +0,0 @@ @@ -1,75 +0,0 @@
/*
* Copyright 2012-present the original author or authors.
*
* Licensed under the Apache License, Version 2.0 (the "License");
* you may not use this file except in compliance with the License.
* You may obtain a copy of the License at
*
* https://www.apache.org/licenses/LICENSE-2.0
*
* Unless required by applicable law or agreed to in writing, software
* distributed under the License is distributed on an "AS IS" BASIS,
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
* See the License for the specific language governing permissions and
* limitations under the License.
*/
package org.springframework.boot.webservices.client;
import java.time.Duration;
import io.netty.channel.ChannelOption;
import org.assertj.core.api.InstanceOfAssertFactories;
import org.junit.jupiter.api.Test;
import reactor.netty.http.client.HttpClient;
import org.springframework.boot.testsupport.classpath.ClassPathExclusions;
import org.springframework.http.client.ClientHttpRequestFactory;
import org.springframework.http.client.ReactorClientHttpRequestFactory;
import org.springframework.ws.transport.WebServiceMessageSender;
import org.springframework.ws.transport.http.ClientHttpRequestMessageSender;
import static org.assertj.core.api.Assertions.assertThat;
/**
* Tests for {@link HttpWebServiceMessageSenderBuilder} when Reactor Netty is the
* predominant HTTP client.
*
* @author Andy Wilkinson
* @deprecated since 3.4.0 for removal in 4.0.0
*/
@ClassPathExclusions({ "httpclient5-*.jar", "jetty-client-*.jar" })
@SuppressWarnings("removal")
@Deprecated(since = "3.4.0", forRemoval = true)
class HttpWebServiceMessageSenderBuilderReactorClientIntegrationTests {
private final HttpWebServiceMessageSenderBuilder builder = new HttpWebServiceMessageSenderBuilder();
@Test
void buildUsesReactorClientIfHttpComponentsAndJettyAreNotAvailable() {
WebServiceMessageSender messageSender = this.builder.build();
assertReactorClientHttpRequestFactory(messageSender);
}
@Test
void buildWithCustomTimeouts() {
WebServiceMessageSender messageSender = this.builder.setConnectTimeout(Duration.ofSeconds(5))
.setReadTimeout(Duration.ofSeconds(2))
.build();
ReactorClientHttpRequestFactory factory = assertReactorClientHttpRequestFactory(messageSender);
assertThat(factory).extracting("httpClient", InstanceOfAssertFactories.type(HttpClient.class))
.extracting((httpClient) -> httpClient.configuration().options(), InstanceOfAssertFactories.MAP)
.containsEntry(ChannelOption.CONNECT_TIMEOUT_MILLIS, 5000);
assertThat(factory).hasFieldOrPropertyWithValue("readTimeout", Duration.ofSeconds(2));
}
private ReactorClientHttpRequestFactory assertReactorClientHttpRequestFactory(
WebServiceMessageSender messageSender) {
assertThat(messageSender).isInstanceOf(ClientHttpRequestMessageSender.class);
ClientHttpRequestMessageSender sender = (ClientHttpRequestMessageSender) messageSender;
ClientHttpRequestFactory requestFactory = sender.getRequestFactory();
assertThat(requestFactory).isInstanceOf(ReactorClientHttpRequestFactory.class);
return (ReactorClientHttpRequestFactory) requestFactory;
}
}

69
spring-boot-project/spring-boot-all/src/test/java/org/springframework/boot/webservices/client/HttpWebServiceMessageSenderBuilderSimpleIntegrationTests.java

@ -1,69 +0,0 @@ @@ -1,69 +0,0 @@
/*
* Copyright 2012-present the original author or authors.
*
* Licensed under the Apache License, Version 2.0 (the "License");
* you may not use this file except in compliance with the License.
* You may obtain a copy of the License at
*
* https://www.apache.org/licenses/LICENSE-2.0
*
* Unless required by applicable law or agreed to in writing, software
* distributed under the License is distributed on an "AS IS" BASIS,
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
* See the License for the specific language governing permissions and
* limitations under the License.
*/
package org.springframework.boot.webservices.client;
import java.time.Duration;
import org.junit.jupiter.api.Test;
import org.springframework.boot.testsupport.classpath.ClassPathExclusions;
import org.springframework.http.client.ClientHttpRequestFactory;
import org.springframework.http.client.SimpleClientHttpRequestFactory;
import org.springframework.ws.transport.WebServiceMessageSender;
import org.springframework.ws.transport.http.ClientHttpRequestMessageSender;
import static org.assertj.core.api.Assertions.assertThat;
/**
* Tests for {@link HttpWebServiceMessageSenderBuilder} when no preferred HTTP clients are
* available
*
* @author Stephane Nicoll
* @deprecated since 3.4.0 for removal in 4.0.0
*/
@ClassPathExclusions({ "httpclient5-*.jar", "jetty-client-*.jar", "reactor-netty-http-*.jar" })
@SuppressWarnings("removal")
@Deprecated(since = "3.4.0", forRemoval = true)
class HttpWebServiceMessageSenderBuilderSimpleIntegrationTests {
private final HttpWebServiceMessageSenderBuilder builder = new HttpWebServiceMessageSenderBuilder();
@Test
void buildUseUseSimpleClientByDefault() {
WebServiceMessageSender messageSender = this.builder.build();
assertSimpleClientRequestFactory(messageSender);
}
@Test
void buildWithCustomTimeouts() {
WebServiceMessageSender messageSender = this.builder.setConnectTimeout(Duration.ofSeconds(5))
.setReadTimeout(Duration.ofSeconds(2))
.build();
SimpleClientHttpRequestFactory requestFactory = assertSimpleClientRequestFactory(messageSender);
assertThat(requestFactory).hasFieldOrPropertyWithValue("connectTimeout", 5000);
assertThat(requestFactory).hasFieldOrPropertyWithValue("readTimeout", 2000);
}
private SimpleClientHttpRequestFactory assertSimpleClientRequestFactory(WebServiceMessageSender messageSender) {
assertThat(messageSender).isInstanceOf(ClientHttpRequestMessageSender.class);
ClientHttpRequestMessageSender sender = (ClientHttpRequestMessageSender) messageSender;
ClientHttpRequestFactory requestFactory = sender.getRequestFactory();
assertThat(requestFactory).isInstanceOf(SimpleClientHttpRequestFactory.class);
return (SimpleClientHttpRequestFactory) requestFactory;
}
}

77
spring-boot-project/spring-boot-all/src/test/java/org/springframework/boot/webservices/client/HttpWebServiceMessageSenderBuilderTests.java

@ -1,77 +0,0 @@ @@ -1,77 +0,0 @@
/*
* Copyright 2012-present the original author or authors.
*
* Licensed under the Apache License, Version 2.0 (the "License");
* you may not use this file except in compliance with the License.
* You may obtain a copy of the License at
*
* https://www.apache.org/licenses/LICENSE-2.0
*
* Unless required by applicable law or agreed to in writing, software
* distributed under the License is distributed on an "AS IS" BASIS,
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
* See the License for the specific language governing permissions and
* limitations under the License.
*/
package org.springframework.boot.webservices.client;
import java.time.Duration;
import org.junit.jupiter.api.Test;
import org.springframework.http.client.ClientHttpRequestFactory;
import org.springframework.http.client.HttpComponentsClientHttpRequestFactory;
import org.springframework.http.client.SimpleClientHttpRequestFactory;
import org.springframework.ws.transport.WebServiceMessageSender;
import org.springframework.ws.transport.http.ClientHttpRequestMessageSender;
import static org.assertj.core.api.Assertions.assertThat;
import static org.mockito.Mockito.mock;
/**
* Tests for {@link HttpWebServiceMessageSenderBuilder}.
*
* @author Stephane Nicoll
* @deprecated since 3.4.0 for removal in 4.0.0
*/
@SuppressWarnings("removal")
@Deprecated(since = "3.4.0", forRemoval = true)
class HttpWebServiceMessageSenderBuilderTests {
@Test
void buildWithRequestFactorySupplier() {
ClientHttpRequestFactory requestFactory = mock(ClientHttpRequestFactory.class);
ClientHttpRequestMessageSender messageSender = build(
new HttpWebServiceMessageSenderBuilder().requestFactory(() -> requestFactory));
assertThat(messageSender.getRequestFactory()).isSameAs(requestFactory);
}
@Test
void buildWithReadAndConnectTimeout() {
ClientHttpRequestMessageSender messageSender = build(
new HttpWebServiceMessageSenderBuilder().requestFactory(SimpleClientHttpRequestFactory::new)
.setConnectTimeout(Duration.ofSeconds(5))
.setReadTimeout(Duration.ofSeconds(2)));
SimpleClientHttpRequestFactory requestFactory = (SimpleClientHttpRequestFactory) messageSender
.getRequestFactory();
assertThat(requestFactory).hasFieldOrPropertyWithValue("connectTimeout", 5000);
assertThat(requestFactory).hasFieldOrPropertyWithValue("readTimeout", 2000);
}
@Test
void buildUsesHttpComponentsByDefault() {
ClientHttpRequestMessageSender messageSender = build(
new HttpWebServiceMessageSenderBuilder().setConnectTimeout(Duration.ofSeconds(5))
.setReadTimeout(Duration.ofSeconds(5)));
ClientHttpRequestFactory requestFactory = messageSender.getRequestFactory();
assertThat(requestFactory).isInstanceOf(HttpComponentsClientHttpRequestFactory.class);
}
private ClientHttpRequestMessageSender build(HttpWebServiceMessageSenderBuilder builder) {
WebServiceMessageSender messageSender = builder.build();
assertThat(messageSender).isInstanceOf(ClientHttpRequestMessageSender.class);
return ((ClientHttpRequestMessageSender) messageSender);
}
}

7
spring-boot-project/spring-boot-autoconfigure-all/build.gradle

@ -197,13 +197,6 @@ dependencies { @@ -197,13 +197,6 @@ dependencies {
optional("org.springframework.session:spring-session-jdbc")
optional("org.springframework.amqp:spring-rabbit")
optional("org.springframework.amqp:spring-rabbit-stream")
optional("org.springframework.ws:spring-ws-core") {
exclude group: "com.sun.mail", module: "jakarta.mail"
exclude group: "jakarta.platform", module: "jakarta.jakartaee-api"
exclude group: "org.eclipse.jetty", module: "jetty-server"
exclude group: "org.eclipse.jetty", module: "jetty-servlet"
exclude group: "jakarta.mail", module: "jakarta.mail-api"
}
optional("redis.clients:jedis")
testImplementation(project(":spring-boot-project:spring-boot-freemarker"))

5
spring-boot-project/spring-boot-autoconfigure-all/src/main/resources/META-INF/additional-spring-configuration-metadata.json

@ -808,11 +808,6 @@ @@ -808,11 +808,6 @@
"reason": "Replaced by the PartEventHttpMessageReader and the PartEvent API.",
"level": "error"
}
},
{
"name": "spring.webservices.wsdl-locations",
"type": "java.util.List<java.lang.String>",
"description": "Comma-separated list of locations of WSDLs and accompanying XSDs to be exposed as beans."
}
],
"hints": [

2
spring-boot-project/spring-boot-autoconfigure-all/src/main/resources/META-INF/spring/org.springframework.boot.autoconfigure.AutoConfiguration.imports

@ -59,5 +59,3 @@ org.springframework.boot.autoconfigure.web.reactive.function.client.WebClientAut @@ -59,5 +59,3 @@ org.springframework.boot.autoconfigure.web.reactive.function.client.WebClientAut
org.springframework.boot.autoconfigure.web.servlet.HttpEncodingAutoConfiguration
org.springframework.boot.autoconfigure.web.servlet.MultipartAutoConfiguration
org.springframework.boot.autoconfigure.websocket.servlet.WebSocketMessagingAutoConfiguration
org.springframework.boot.autoconfigure.webservices.WebServicesAutoConfiguration
org.springframework.boot.autoconfigure.webservices.client.WebServiceTemplateAutoConfiguration

3
spring-boot-project/spring-boot-dependencies/build.gradle

@ -2103,7 +2103,8 @@ bom { @@ -2103,7 +2103,8 @@ bom {
"spring-boot-tx",
"spring-boot-undertow",
"spring-boot-validation",
"spring-boot-webmvc"
"spring-boot-webmvc",
"spring-boot-webservices"
]
plugins = [
"spring-boot-maven-plugin"

3
spring-boot-project/spring-boot-docs/build.gradle

@ -128,6 +128,7 @@ dependencies { @@ -128,6 +128,7 @@ dependencies {
autoConfiguration(project(path: ":spring-boot-project:spring-boot-undertow", configuration: "autoConfigurationMetadata"))
autoConfiguration(project(path: ":spring-boot-project:spring-boot-validation", configuration: "autoConfigurationMetadata"))
autoConfiguration(project(path: ":spring-boot-project:spring-boot-webmvc", configuration: "autoConfigurationMetadata"))
autoConfiguration(project(path: ":spring-boot-project:spring-boot-webservices", configuration: "autoConfigurationMetadata"))
configurationProperties(project(path: ":spring-boot-project:spring-boot", configuration: "configurationPropertiesMetadata"))
configurationProperties(project(path: ":spring-boot-project:spring-boot-activemq", configuration: "configurationPropertiesMetadata"))
@ -183,6 +184,7 @@ dependencies { @@ -183,6 +184,7 @@ dependencies {
configurationProperties(project(path: ":spring-boot-project:spring-boot-tx", configuration: "configurationPropertiesMetadata"))
configurationProperties(project(path: ":spring-boot-project:spring-boot-undertow", configuration: "configurationPropertiesMetadata"))
configurationProperties(project(path: ":spring-boot-project:spring-boot-webmvc", configuration: "configurationPropertiesMetadata"))
configurationProperties(project(path: ":spring-boot-project:spring-boot-webservices", configuration: "configurationPropertiesMetadata"))
dokkatoo(project(path: ":spring-boot-project:spring-boot-all"))
dokkatoo(project(path: ":spring-boot-project:spring-boot-test"))
@ -214,6 +216,7 @@ dependencies { @@ -214,6 +216,7 @@ dependencies {
implementation(project(path: ":spring-boot-project:spring-boot-tools:spring-boot-loader-tools"))
implementation(project(path: ":spring-boot-project:spring-boot-undertow"))
implementation(project(path: ":spring-boot-project:spring-boot-webmvc"))
implementation(project(path: ":spring-boot-project:spring-boot-webservices"))
implementation("ch.qos.logback:logback-classic")
implementation("com.redis:testcontainers-redis")
implementation("com.zaxxer:HikariCP")

3
spring-boot-project/spring-boot-starters/spring-boot-starter-web-services/build.gradle

@ -22,8 +22,7 @@ description = "Starter for using Spring Web Services" @@ -22,8 +22,7 @@ description = "Starter for using Spring Web Services"
dependencies {
api(project(":spring-boot-project:spring-boot-starters:spring-boot-starter-web"))
api(project(":spring-boot-project:spring-boot-webservices"))
api("com.sun.xml.messaging.saaj:saaj-impl")
api("jakarta.xml.ws:jakarta.xml.ws-api")
api("org.springframework:spring-oxm")
api("org.springframework.ws:spring-ws-core")
}

1
spring-boot-project/spring-boot-test-autoconfigure/build.gradle

@ -77,6 +77,7 @@ dependencies { @@ -77,6 +77,7 @@ dependencies {
optional(project(":spring-boot-project:spring-boot-tx"))
optional(project(":spring-boot-project:spring-boot-validation"))
optional(project(":spring-boot-project:spring-boot-webmvc"))
optional(project(":spring-boot-project:spring-boot-webservices"))
optional("jakarta.json.bind:jakarta.json.bind-api")
optional("jakarta.persistence:jakarta.persistence-api")
optional("jakarta.servlet:jakarta.servlet-api")

2
spring-boot-project/spring-boot-test-autoconfigure/src/main/java/org/springframework/boot/test/autoconfigure/webservices/client/WebServiceClientTemplateAutoConfiguration.java

@ -20,7 +20,7 @@ import org.springframework.boot.autoconfigure.AutoConfiguration; @@ -20,7 +20,7 @@ import org.springframework.boot.autoconfigure.AutoConfiguration;
import org.springframework.boot.autoconfigure.condition.ConditionalOnBean;
import org.springframework.boot.autoconfigure.condition.ConditionalOnBooleanProperty;
import org.springframework.boot.autoconfigure.condition.ConditionalOnClass;
import org.springframework.boot.autoconfigure.webservices.client.WebServiceTemplateAutoConfiguration;
import org.springframework.boot.webservices.autoconfigure.client.WebServiceTemplateAutoConfiguration;
import org.springframework.boot.webservices.client.WebServiceTemplateBuilder;
import org.springframework.context.annotation.Bean;
import org.springframework.ws.client.core.WebServiceTemplate;

2
spring-boot-project/spring-boot-test-autoconfigure/src/main/resources/META-INF/spring/org.springframework.boot.test.autoconfigure.webservices.client.AutoConfigureWebServiceClient.imports

@ -1,3 +1,3 @@ @@ -1,3 +1,3 @@
# AutoConfigureWebServiceClient
org.springframework.boot.test.autoconfigure.webservices.client.WebServiceClientTemplateAutoConfiguration
org.springframework.boot.autoconfigure.webservices.client.WebServiceTemplateAutoConfiguration
org.springframework.boot.webservices.autoconfigure.client.WebServiceTemplateAutoConfiguration

2
spring-boot-project/spring-boot-test-autoconfigure/src/main/resources/META-INF/spring/org.springframework.boot.test.autoconfigure.webservices.server.AutoConfigureWebServiceServer.imports

@ -1,2 +1,2 @@ @@ -1,2 +1,2 @@
# AutoConfigureWebServiceServer auto-configuration imports
org.springframework.boot.autoconfigure.webservices.WebServicesAutoConfiguration
org.springframework.boot.webservices.autoconfigure.WebServicesAutoConfiguration

43
spring-boot-project/spring-boot-webservices/build.gradle

@ -0,0 +1,43 @@ @@ -0,0 +1,43 @@
/*
* Copyright 2012-present the original author or authors.
*
* Licensed under the Apache License, Version 2.0 (the License);
* you may not use this file except in compliance with the License.
* You may obtain a copy of the License at
*
* https://www.apache.org/licenses/LICENSE-2.0
*
* Unless required by applicable law or agreed to in writing, software
* distributed under the License is distributed on an "AS IS" BASIS,
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
* See the License for the specific language governing permissions and
* limitations under the License.
*/
plugins {
id "java-library"
id "org.springframework.boot.auto-configuration"
id "org.springframework.boot.configuration-properties"
id "org.springframework.boot.deployed"
id "org.springframework.boot.optional-dependencies"
}
description = "Spring Boot Web Services"
dependencies {
api(project(":spring-boot-project:spring-boot"))
api("org.springframework:spring-oxm")
api("org.springframework.ws:spring-ws-core")
optional(project(":spring-boot-project:spring-boot-autoconfigure"))
optional("jakarta.servlet:jakarta.servlet-api")
testImplementation(project(":spring-boot-project:spring-boot-test"))
testImplementation(project(":spring-boot-project:spring-boot-tools:spring-boot-test-support"))
testImplementation("org.eclipse.jetty:jetty-client")
testRuntimeOnly("ch.qos.logback:logback-classic")
testRuntimeOnly("io.projectreactor.netty:reactor-netty-http")
testRuntimeOnly("org.apache.httpcomponents.client5:httpclient5")
}

2
spring-boot-project/spring-boot-autoconfigure-all/src/main/java/org/springframework/boot/autoconfigure/webservices/OnWsdlLocationsCondition.java → spring-boot-project/spring-boot-webservices/src/main/java/org/springframework/boot/webservices/autoconfigure/OnWsdlLocationsCondition.java

@ -14,7 +14,7 @@ @@ -14,7 +14,7 @@
* limitations under the License.
*/
package org.springframework.boot.autoconfigure.webservices;
package org.springframework.boot.webservices.autoconfigure;
import org.springframework.boot.autoconfigure.condition.ConditionMessage;
import org.springframework.boot.autoconfigure.condition.OnPropertyListCondition;

2
spring-boot-project/spring-boot-autoconfigure-all/src/main/java/org/springframework/boot/autoconfigure/webservices/WebServicesAutoConfiguration.java → spring-boot-project/spring-boot-webservices/src/main/java/org/springframework/boot/webservices/autoconfigure/WebServicesAutoConfiguration.java

@ -14,7 +14,7 @@ @@ -14,7 +14,7 @@
* limitations under the License.
*/
package org.springframework.boot.autoconfigure.webservices;
package org.springframework.boot.webservices.autoconfigure;
import java.io.IOException;
import java.util.Collections;

2
spring-boot-project/spring-boot-autoconfigure-all/src/main/java/org/springframework/boot/autoconfigure/webservices/WebServicesProperties.java → spring-boot-project/spring-boot-webservices/src/main/java/org/springframework/boot/webservices/autoconfigure/WebServicesProperties.java

@ -14,7 +14,7 @@ @@ -14,7 +14,7 @@
* limitations under the License.
*/
package org.springframework.boot.autoconfigure.webservices;
package org.springframework.boot.webservices.autoconfigure;
import java.util.HashMap;
import java.util.Map;

7
spring-boot-project/spring-boot-autoconfigure-all/src/main/java/org/springframework/boot/autoconfigure/webservices/client/WebServiceTemplateAutoConfiguration.java → spring-boot-project/spring-boot-webservices/src/main/java/org/springframework/boot/webservices/autoconfigure/client/WebServiceTemplateAutoConfiguration.java

@ -14,7 +14,7 @@ @@ -14,7 +14,7 @@
* limitations under the License.
*/
package org.springframework.boot.autoconfigure.webservices.client;
package org.springframework.boot.webservices.autoconfigure.client;
import java.util.List;
@ -23,7 +23,6 @@ import org.springframework.boot.autoconfigure.AutoConfiguration; @@ -23,7 +23,6 @@ import org.springframework.boot.autoconfigure.AutoConfiguration;
import org.springframework.boot.autoconfigure.EnableAutoConfiguration;
import org.springframework.boot.autoconfigure.condition.ConditionalOnClass;
import org.springframework.boot.autoconfigure.condition.ConditionalOnMissingBean;
import org.springframework.boot.autoconfigure.http.client.HttpClientAutoConfiguration;
import org.springframework.boot.http.client.ClientHttpRequestFactoryBuilder;
import org.springframework.boot.http.client.ClientHttpRequestFactorySettings;
import org.springframework.boot.webservices.client.WebServiceMessageSenderFactory;
@ -38,9 +37,9 @@ import org.springframework.ws.client.core.WebServiceTemplate; @@ -38,9 +37,9 @@ import org.springframework.ws.client.core.WebServiceTemplate;
* {@link EnableAutoConfiguration Auto-configuration} for {@link WebServiceTemplate}.
*
* @author Dmytro Nosan
* @since 2.1.0
* @since 4.0.0
*/
@AutoConfiguration(after = HttpClientAutoConfiguration.class)
@AutoConfiguration
@ConditionalOnClass({ WebServiceTemplate.class, Unmarshaller.class, Marshaller.class })
public class WebServiceTemplateAutoConfiguration {

2
spring-boot-project/spring-boot-autoconfigure-all/src/main/java/org/springframework/boot/autoconfigure/webservices/client/package-info.java → spring-boot-project/spring-boot-webservices/src/main/java/org/springframework/boot/webservices/autoconfigure/client/package-info.java

@ -17,4 +17,4 @@ @@ -17,4 +17,4 @@
/**
* Auto-configuration for Spring Web Services Clients.
*/
package org.springframework.boot.autoconfigure.webservices.client;
package org.springframework.boot.webservices.autoconfigure.client;

2
spring-boot-project/spring-boot-autoconfigure-all/src/main/java/org/springframework/boot/autoconfigure/webservices/package-info.java → spring-boot-project/spring-boot-webservices/src/main/java/org/springframework/boot/webservices/autoconfigure/package-info.java

@ -17,4 +17,4 @@ @@ -17,4 +17,4 @@
/**
* Auto-configuration for Spring Web Services.
*/
package org.springframework.boot.autoconfigure.webservices;
package org.springframework.boot.webservices.autoconfigure;

0
spring-boot-project/spring-boot-all/src/main/java/org/springframework/boot/webservices/client/WebServiceMessageSenderFactory.java → spring-boot-project/spring-boot-webservices/src/main/java/org/springframework/boot/webservices/client/WebServiceMessageSenderFactory.java

2
spring-boot-project/spring-boot-all/src/main/java/org/springframework/boot/webservices/client/WebServiceTemplateBuilder.java → spring-boot-project/spring-boot-webservices/src/main/java/org/springframework/boot/webservices/client/WebServiceTemplateBuilder.java

@ -117,7 +117,6 @@ public class WebServiceTemplateBuilder { @@ -117,7 +117,6 @@ public class WebServiceTemplateBuilder {
* @param messageSenderFactory the {@link WebServiceMessageSenderFactory} to use
* @return a new builder instance
* @since 3.4.0
* @see HttpWebServiceMessageSenderBuilder
*/
public WebServiceTemplateBuilder httpMessageSenderFactory(WebServiceMessageSenderFactory messageSenderFactory) {
Assert.notNull(messageSenderFactory, "'messageSenderFactory' must not be null");
@ -132,7 +131,6 @@ public class WebServiceTemplateBuilder { @@ -132,7 +131,6 @@ public class WebServiceTemplateBuilder {
* @param detectHttpMessageSender if an HTTP-based {@link WebServiceMessageSender}
* should be detected
* @return a new builder instance
* @see HttpWebServiceMessageSenderBuilder
*/
public WebServiceTemplateBuilder detectHttpMessageSender(boolean detectHttpMessageSender) {
return new WebServiceTemplateBuilder(this.httpMessageSenderFactory, detectHttpMessageSender, this.interceptors,

0
spring-boot-project/spring-boot-all/src/main/java/org/springframework/boot/webservices/client/WebServiceTemplateCustomizer.java → spring-boot-project/spring-boot-webservices/src/main/java/org/springframework/boot/webservices/client/WebServiceTemplateCustomizer.java

0
spring-boot-project/spring-boot-all/src/main/java/org/springframework/boot/webservices/client/package-info.java → spring-boot-project/spring-boot-webservices/src/main/java/org/springframework/boot/webservices/client/package-info.java

9
spring-boot-project/spring-boot-webservices/src/main/resources/META-INF/additional-spring-configuration-metadata.json

@ -0,0 +1,9 @@ @@ -0,0 +1,9 @@
{
"properties": [
{
"name": "spring.webservices.wsdl-locations",
"type": "java.util.List<java.lang.String>",
"description": "Comma-separated list of locations of WSDLs and accompanying XSDs to be exposed as beans."
}
]
}

2
spring-boot-project/spring-boot-webservices/src/main/resources/META-INF/spring/org.springframework.boot.autoconfigure.AutoConfiguration.imports

@ -0,0 +1,2 @@ @@ -0,0 +1,2 @@
org.springframework.boot.webservices.autoconfigure.WebServicesAutoConfiguration
org.springframework.boot.webservices.autoconfigure.client.WebServiceTemplateAutoConfiguration

2
spring-boot-project/spring-boot-autoconfigure-all/src/test/java/org/springframework/boot/autoconfigure/webservices/OnWsdlLocationsConditionTests.java → spring-boot-project/spring-boot-webservices/src/test/java/org/springframework/boot/webservices/autoconfigure/OnWsdlLocationsConditionTests.java

@ -14,7 +14,7 @@ @@ -14,7 +14,7 @@
* limitations under the License.
*/
package org.springframework.boot.autoconfigure.webservices;
package org.springframework.boot.webservices.autoconfigure;
import org.junit.jupiter.api.Test;

2
spring-boot-project/spring-boot-autoconfigure-all/src/test/java/org/springframework/boot/autoconfigure/webservices/WebServicesAutoConfigurationTests.java → spring-boot-project/spring-boot-webservices/src/test/java/org/springframework/boot/webservices/autoconfigure/WebServicesAutoConfigurationTests.java

@ -14,7 +14,7 @@ @@ -14,7 +14,7 @@
* limitations under the License.
*/
package org.springframework.boot.autoconfigure.webservices;
package org.springframework.boot.webservices.autoconfigure;
import java.util.Collection;

2
spring-boot-project/spring-boot-autoconfigure-all/src/test/java/org/springframework/boot/autoconfigure/webservices/WebServicesPropertiesTests.java → spring-boot-project/spring-boot-webservices/src/test/java/org/springframework/boot/webservices/autoconfigure/WebServicesPropertiesTests.java

@ -14,7 +14,7 @@ @@ -14,7 +14,7 @@
* limitations under the License.
*/
package org.springframework.boot.autoconfigure.webservices;
package org.springframework.boot.webservices.autoconfigure;
import org.junit.jupiter.api.Test;

14
spring-boot-project/spring-boot-autoconfigure-all/src/test/java/org/springframework/boot/autoconfigure/webservices/client/WebServiceTemplateAutoConfigurationTests.java → spring-boot-project/spring-boot-webservices/src/test/java/org/springframework/boot/webservices/autoconfigure/client/WebServiceTemplateAutoConfigurationTests.java

@ -14,15 +14,14 @@ @@ -14,15 +14,14 @@
* limitations under the License.
*/
package org.springframework.boot.autoconfigure.webservices.client;
package org.springframework.boot.webservices.autoconfigure.client;
import java.util.function.Consumer;
import org.junit.jupiter.api.Test;
import org.springframework.boot.autoconfigure.AutoConfigurations;
import org.springframework.boot.autoconfigure.http.client.HttpClientAutoConfiguration;
import org.springframework.boot.http.autoconfigure.HttpMessageConvertersAutoConfiguration;
import org.springframework.boot.http.client.ClientHttpRequestFactoryBuilder;
import org.springframework.boot.test.context.assertj.AssertableApplicationContext;
import org.springframework.boot.test.context.runner.ApplicationContextRunner;
import org.springframework.boot.test.context.runner.ContextConsumer;
@ -48,8 +47,8 @@ import static org.assertj.core.api.Assertions.assertThat; @@ -48,8 +47,8 @@ import static org.assertj.core.api.Assertions.assertThat;
*/
class WebServiceTemplateAutoConfigurationTests {
private final ApplicationContextRunner contextRunner = new ApplicationContextRunner().withConfiguration(
AutoConfigurations.of(WebServiceTemplateAutoConfiguration.class, HttpClientAutoConfiguration.class));
private final ApplicationContextRunner contextRunner = new ApplicationContextRunner()
.withConfiguration(AutoConfigurations.of(WebServiceTemplateAutoConfiguration.class));
@Test
void autoConfiguredBuilderShouldNotHaveMarshallerAndUnmarshaller() {
@ -97,9 +96,8 @@ class WebServiceTemplateAutoConfigurationTests { @@ -97,9 +96,8 @@ class WebServiceTemplateAutoConfigurationTests {
}
@Test
void whenHasFactoryProperty() {
this.contextRunner.withConfiguration(AutoConfigurations.of(HttpMessageConvertersAutoConfiguration.class))
.withPropertyValues("spring.http.client.factory=simple")
void whenHasFactory() {
this.contextRunner.withBean(ClientHttpRequestFactoryBuilder.class, ClientHttpRequestFactoryBuilder::simple)
.run(assertWebServiceTemplateBuilder((builder) -> {
WebServiceTemplate webServiceTemplate = builder.build();
assertThat(webServiceTemplate.getMessageSenders()).hasSize(1);

0
spring-boot-project/spring-boot-all/src/test/java/org/springframework/boot/webservices/client/WebServiceMessageSenderFactoryTests.java → spring-boot-project/spring-boot-webservices/src/test/java/org/springframework/boot/webservices/client/WebServiceMessageSenderFactoryTests.java

0
spring-boot-project/spring-boot-all/src/test/java/org/springframework/boot/webservices/client/WebServiceTemplateBuilderTests.java → spring-boot-project/spring-boot-webservices/src/test/java/org/springframework/boot/webservices/client/WebServiceTemplateBuilderTests.java

Loading…
Cancel
Save