This is an automated email from the ASF dual-hosted git repository. fmariani pushed a commit to branch main in repository https://gitbox.apache.org/repos/asf/camel-spring-boot-examples.git
commit d3b3ceeb66149747f1368a8df1054693e1496cd5 Author: Croway <[email protected]> AuthorDate: Wed Sep 20 16:56:45 2023 +0200 Update to Camel4 --- soap-cxf/pom.xml | 12 +----------- .../java/sample/camel/repository/CustomerRepository.java | 2 +- soap-cxf/src/main/java/sample/camel/service/Address.java | 2 +- soap-cxf/src/main/java/sample/camel/service/Contact.java | 4 ++-- .../java/sample/camel/service/NoSuchContactException.java | 2 +- soap-cxf/src/main/resources/binding.xml | 3 ++- soap-cxf/src/test/java/sample/camel/WsdlClientTest.java | 5 ++--- 7 files changed, 10 insertions(+), 20 deletions(-) diff --git a/soap-cxf/pom.xml b/soap-cxf/pom.xml index 66e8340..e036959 100644 --- a/soap-cxf/pom.xml +++ b/soap-cxf/pom.xml @@ -23,7 +23,7 @@ <parent> <groupId>org.apache.camel.springboot.example</groupId> <artifactId>examples</artifactId> - <version>3.19.0-SNAPSHOT</version> + <version>4.1.0-SNAPSHOT</version> </parent> <artifactId>camel-example-spring-boot-soap-cxf</artifactId> @@ -70,16 +70,6 @@ <dependency> <groupId>org.springframework.boot</groupId> <artifactId>spring-boot-starter-web</artifactId> - <exclusions> - <exclusion> - <groupId>org.springframework.boot</groupId> - <artifactId>spring-boot-starter-tomcat</artifactId> - </exclusion> - </exclusions> - </dependency> - <dependency> - <groupId>org.springframework.boot</groupId> - <artifactId>spring-boot-starter-undertow</artifactId> </dependency> <dependency> <groupId>org.springframework.boot</groupId> diff --git a/soap-cxf/src/main/java/sample/camel/repository/CustomerRepository.java b/soap-cxf/src/main/java/sample/camel/repository/CustomerRepository.java index 94de123..dcd1187 100644 --- a/soap-cxf/src/main/java/sample/camel/repository/CustomerRepository.java +++ b/soap-cxf/src/main/java/sample/camel/repository/CustomerRepository.java @@ -21,7 +21,7 @@ import org.springframework.stereotype.Repository; import com.example.customerservice.Customer; import com.example.customerservice.CustomerType; -import javax.annotation.PostConstruct; +import jakarta.annotation.PostConstruct; import java.time.LocalDate; import java.util.ArrayList; diff --git a/soap-cxf/src/main/java/sample/camel/service/Address.java b/soap-cxf/src/main/java/sample/camel/service/Address.java index 104fc0c..8bea331 100644 --- a/soap-cxf/src/main/java/sample/camel/service/Address.java +++ b/soap-cxf/src/main/java/sample/camel/service/Address.java @@ -16,7 +16,7 @@ */ package sample.camel.service; -import javax.validation.constraints.Pattern; +import jakarta.validation.constraints.Pattern; public class Address { diff --git a/soap-cxf/src/main/java/sample/camel/service/Contact.java b/soap-cxf/src/main/java/sample/camel/service/Contact.java index 58008f7..c25a892 100644 --- a/soap-cxf/src/main/java/sample/camel/service/Contact.java +++ b/soap-cxf/src/main/java/sample/camel/service/Contact.java @@ -16,8 +16,8 @@ */ package sample.camel.service; -import javax.validation.Valid; -import javax.validation.constraints.Size; +import jakarta.validation.Valid; +import jakarta.validation.constraints.Size; import java.util.Objects; diff --git a/soap-cxf/src/main/java/sample/camel/service/NoSuchContactException.java b/soap-cxf/src/main/java/sample/camel/service/NoSuchContactException.java index 1f5bc46..3716328 100644 --- a/soap-cxf/src/main/java/sample/camel/service/NoSuchContactException.java +++ b/soap-cxf/src/main/java/sample/camel/service/NoSuchContactException.java @@ -16,7 +16,7 @@ */ package sample.camel.service; -import javax.xml.ws.WebFault; +import jakarta.xml.ws.WebFault; @WebFault(name = "NoSuchContact") public class NoSuchContactException extends Exception { diff --git a/soap-cxf/src/main/resources/binding.xml b/soap-cxf/src/main/resources/binding.xml index f736f76..1dee63b 100644 --- a/soap-cxf/src/main/resources/binding.xml +++ b/soap-cxf/src/main/resources/binding.xml @@ -17,7 +17,8 @@ specific language governing permissions and limitations under the License. --> -<jaxws:bindings xmlns:jaxws="http://java.sun.com/xml/ns/jaxws" xmlns:xs="http://www.w3.org/2001/XMLSchema" xmlns:jxb="http://java.sun.com/xml/ns/jaxb" xmlns:wsdl="http://schemas.xmlsoap.org/wsdl/" wsdlLocation="wsdl/CustomerService.wsdl"> +<jaxws:bindings xmlns:jaxws="https://jakarta.ee/xml/ns/jaxws" xmlns:xs="http://www.w3.org/2001/XMLSchema" xmlns:jxb="https://jakarta.ee/xml/ns/jaxb" + xmlns:wsdl="http://schemas.xmlsoap.org/wsdl/" wsdlLocation="wsdl/CustomerService.wsdl"> <jaxws:bindings node="wsdl:definitions/wsdl:types/xs:schema"> <jxb:globalBindings> <jxb:javaType name="java.time.LocalDateTime" xmlType="xs:dateTime" parseMethod="sample.camel.adapter.DataTypeAdapter.parseDateTime" printMethod="sample.camel.adapter.DataTypeAdapter.printDateTime"/> diff --git a/soap-cxf/src/test/java/sample/camel/WsdlClientTest.java b/soap-cxf/src/test/java/sample/camel/WsdlClientTest.java index 2e428b2..e27dcda 100644 --- a/soap-cxf/src/test/java/sample/camel/WsdlClientTest.java +++ b/soap-cxf/src/test/java/sample/camel/WsdlClientTest.java @@ -19,6 +19,7 @@ package sample.camel; import static org.junit.jupiter.api.Assertions.assertEquals; import static org.junit.jupiter.api.Assertions.assertNotEquals; +import jakarta.xml.ws.WebServiceException; import org.apache.cxf.ext.logging.LoggingFeature; import org.apache.cxf.frontend.ClientProxyFactoryBean; import org.apache.cxf.jaxws.JaxWsProxyFactoryBean; @@ -35,8 +36,6 @@ import com.example.customerservice.Customer; import com.example.customerservice.CustomerService; import com.example.customerservice.NoSuchCustomerException; -import javax.xml.ws.soap.SOAPFaultException; - import java.time.Duration; import java.time.LocalDate; import java.util.List; @@ -81,7 +80,7 @@ public class WsdlClientTest { @Test public void testInvalidRequest() { Assertions.assertThatThrownBy(() -> cxfClient.getCustomersByName("a")) - .isInstanceOf(SOAPFaultException.class); + .isInstanceOf(WebServiceException.class); } @Test
