From b6b3773954def0741f41bb9ad3369f4cb34412ce Mon Sep 17 00:00:00 2001 From: "Greg L. Turnquist" Date: Tue, 1 Aug 2023 16:42:20 -0500 Subject: [PATCH] Upgrade to Java 17. Ensure that the Maven bits use the updated mechanisms to consume a WSDL and generate the SOAP Java types for a Spring WS client to talk to the server. --- README.adoc | 16 +---- complete/pom.xml | 67 ++++++------------- initial/pom.xml | 9 +-- .../src/main/resources/application.properties | 1 - initial/src/main/resources/application.yml | 6 ++ 5 files changed, 31 insertions(+), 68 deletions(-) delete mode 100644 initial/src/main/resources/application.properties create mode 100644 initial/src/main/resources/application.yml diff --git a/README.adoc b/README.adoc index ff5dcf9..c60ab9b 100644 --- a/README.adoc +++ b/README.adoc @@ -20,16 +20,11 @@ The service provides country data. You will be able to query data about a countr == What You Need -:java_version: 1.8 +:java_version: 17 include::https://raw.githubusercontent.com/spring-guides/getting-started-macros/main/prereq_editor_jdk_buildtools.adoc[] include::https://raw.githubusercontent.com/spring-guides/getting-started-macros/main/how_to_complete_this_guide.adoc[] -NOTE: If you read link:/guides/gs/producing-web-service[Producing a SOAP web service], you -might wonder why this guide does not use `spring-boot-starter-ws`? That Spring Boot -starter is only for server-side web services. That starter brings on board such things as -embedded Tomcat, which is not needed to make a web call. - == Run the Target Web Service Locally Follow the steps in the @@ -79,15 +74,6 @@ include::complete/pom.xml[tags=dependency] ---- ==== -The following listing shows the profile you need to add in Maven if you want it to work with Java 11: - -==== -[source,xml,indent=0] ----- -include::complete/pom.xml[tags=profile] ----- -==== - The <> section describes the WSDL generation plugin. The following listing shows the final `pom.xml` file: diff --git a/complete/pom.xml b/complete/pom.xml index 94ea021..305ae56 100644 --- a/complete/pom.xml +++ b/complete/pom.xml @@ -5,9 +5,8 @@ org.springframework.boot spring-boot-starter-parent - 2.7.1 - - + 3.1.2 + com.example consuming-web-service-complete @@ -16,14 +15,10 @@ Demo project for Spring Boot - 1.8 + 17 - - org.springframework.boot - spring-boot-starter - org.springframework.boot @@ -44,24 +39,6 @@ - - - - java11 - - [11,) - - - - - org.glassfish.jaxb - jaxb-runtime - - - - - - @@ -70,25 +47,25 @@ - org.jvnet.jaxb2.maven2 - maven-jaxb2-plugin - 0.14.0 - - - - generate - - - - - WSDL - com.example.consumingwebservice.wsdl - - - http://localhost:8080/ws/countries.wsdl - - - + com.sun.xml.ws + jaxws-maven-plugin + 3.0.0 + + + + wsimport + + + + + com.example.consumingwebservice.wsdl + + http://localhost:8080/ws/countries.wsdl + + ${sourcesDir} + ${classesDir} + true + diff --git a/initial/pom.xml b/initial/pom.xml index 51940ba..de5071e 100644 --- a/initial/pom.xml +++ b/initial/pom.xml @@ -5,7 +5,7 @@ org.springframework.boot spring-boot-starter-parent - 2.7.1 + 3.1.2 com.example @@ -15,15 +15,10 @@ Demo project for Spring Boot - 1.8 + 17 - - org.springframework.boot - spring-boot-starter - - org.springframework.boot spring-boot-starter-test diff --git a/initial/src/main/resources/application.properties b/initial/src/main/resources/application.properties deleted file mode 100644 index 8b13789..0000000 --- a/initial/src/main/resources/application.properties +++ /dev/null @@ -1 +0,0 @@ - diff --git a/initial/src/main/resources/application.yml b/initial/src/main/resources/application.yml new file mode 100644 index 0000000..9bf50e7 --- /dev/null +++ b/initial/src/main/resources/application.yml @@ -0,0 +1,6 @@ +logging: + level: + com.example.consumingwebservice: INFO + org: + springframework: + ws: DEBUG