From 21379f513ba2509f4a78cc41f4d1839ee4072388 Mon Sep 17 00:00:00 2001 From: Gustavo Martin Morcuende Date: Sun, 20 Dec 2015 22:00:13 +0100 Subject: [PATCH] jaxb2 and cxf: multiple changes --- cxf/web-services-spring-cxf-client/pom.xml | 1 - .../main/build-resources/bindings/custombinding.xjb | 12 ++++++++++-- .../src/main/build-resources/wsdl/example.wsdl | 18 ++---------------- .../webservices/client/ExampleClientService.java | 20 ++++++++++---------- .../java/de/spring/webservices/client/MainTest.java | 10 +++++----- .../src/main/resources/examples.xsd | 18 ++---------------- .../ws/client-spring-configuration.xml | 7 ++++++- .../client/ExampleClientServiceIntegrationTest.java | 4 ++-- cxf/web-services-spring-cxf-globalxsds/pom.xml | 2 +- .../src/main/resources/parent.xsd | 7 +++++++ cxf/web-services-spring-cxf-server/pom.xml | 2 +- .../webservices/endpoints/ExampleEndPoint.java | 8 ++++---- .../endpoints/MyCustomMappingExceptionResolver.java | 6 +++--- .../spring/webservices/services/ExampleService.java | 4 ++-- .../impl/CustomBindingExampleServiceImpl.java | 10 ++++------ .../services/impl/ExampleServiceImpl.java | 4 ++-- .../src/main/resources/examples.xsd | 18 ++---------------- .../resources/spring-configuration/ws/soap-ws.xml | 9 +++++++-- .../webservices/endpoints/ExampleEndPointTest.java | 6 +++--- .../services/CustomBindingExampleServiceTest.java | 4 ++-- .../webservices/services/ExampleServiceTest.java | 4 ++-- jaxb2/web-services-spring-jaxb2-client/pom.xml | 2 +- .../src/main/build-resources/wsdl/example.wsdl | 18 ++---------------- .../webservices/client/ExampleClientService.java | 14 +++++++------- .../java/de/spring/webservices/client/MainTest.java | 4 ++-- .../src/main/resources/schemas/examples.xsd | 18 ++---------------- .../ws/client-spring-configuration.xml | 7 ++++++- .../client/ExampleClientServiceIntegrationTest.java | 4 ++-- jaxb2/web-services-spring-jaxb2-globalxsds/pom.xml | 2 +- .../src/main/resources/schemas/parent.xsd | 7 +++++++ jaxb2/web-services-spring-jaxb2-server/pom.xml | 2 +- .../webservices/endpoints/ExampleEndPoint.java | 8 ++++---- .../endpoints/MyCustomMappingExceptionResolver.java | 6 +++--- .../spring/webservices/services/ExampleService.java | 4 ++-- .../impl/CustomBindingExampleServiceImpl.java | 10 ++++------ .../services/impl/ExampleServiceImpl.java | 4 ++-- .../src/main/resources/schemas/examples.xsd | 18 ++---------------- .../resources/spring-configuration/ws/soap-ws.xml | 9 +++++++-- .../webservices/endpoints/ExampleEndPointTest.java | 6 +++--- .../services/CustomBindingExampleServiceTest.java | 4 ++-- .../webservices/services/ExampleServiceTest.java | 4 ++-- 41 files changed, 139 insertions(+), 186 deletions(-) diff --git a/cxf/web-services-spring-cxf-client/pom.xml b/cxf/web-services-spring-cxf-client/pom.xml index 8c2ca58..c3de39a 100644 --- a/cxf/web-services-spring-cxf-client/pom.xml +++ b/cxf/web-services-spring-cxf-client/pom.xml @@ -103,7 +103,6 @@ ${project.wsdl.target.path} - ${project.wsdl.sources.path}/example.wsdl ${project.bindings.path}/custombinding.xjb diff --git a/cxf/web-services-spring-cxf-client/src/main/build-resources/bindings/custombinding.xjb b/cxf/web-services-spring-cxf-client/src/main/build-resources/bindings/custombinding.xjb index 95e1fd2..38ddbe1 100644 --- a/cxf/web-services-spring-cxf-client/src/main/build-resources/bindings/custombinding.xjb +++ b/cxf/web-services-spring-cxf-client/src/main/build-resources/bindings/custombinding.xjb @@ -10,9 +10,13 @@ jaxb:version="2.1" jaxb:extensionBindingPrefixes="xjc inheritance annox"> + - + @@ -26,8 +30,12 @@ + - + diff --git a/cxf/web-services-spring-cxf-client/src/main/build-resources/wsdl/example.wsdl b/cxf/web-services-spring-cxf-client/src/main/build-resources/wsdl/example.wsdl index f0ddf0f..9b3fdaf 100644 --- a/cxf/web-services-spring-cxf-client/src/main/build-resources/wsdl/example.wsdl +++ b/cxf/web-services-spring-cxf-client/src/main/build-resources/wsdl/example.wsdl @@ -54,14 +54,7 @@ - - - - - - - - + diff --git a/cxf/web-services-spring-cxf-client/src/main/java/de/spring/webservices/client/ExampleClientService.java b/cxf/web-services-spring-cxf-client/src/main/java/de/spring/webservices/client/ExampleClientService.java index 578bcca..c7d9758 100644 --- a/cxf/web-services-spring-cxf-client/src/main/java/de/spring/webservices/client/ExampleClientService.java +++ b/cxf/web-services-spring-cxf-client/src/main/java/de/spring/webservices/client/ExampleClientService.java @@ -6,14 +6,14 @@ import org.springframework.beans.factory.annotation.Autowired; import org.springframework.stereotype.Service; import org.springframework.ws.client.core.WebServiceTemplate; -import de.spring.webservices.auto.CustomBindingExampleFault_Exception; -import de.spring.webservices.auto.CustomBindingExampleRequest; -import de.spring.webservices.auto.CustomBindingExampleResponse; -import de.spring.webservices.auto.ExampleFault_Exception; -import de.spring.webservices.auto.ExampleRequest; -import de.spring.webservices.auto.ExampleResponse; -import de.spring.webservices.auto.Examples; -import de.spring.webservices.auto.ExamplesService; +import de.spring.webservices.client.auto.CustomBindingExampleFault; +import de.spring.webservices.client.auto.CustomBindingExampleRequest; +import de.spring.webservices.client.auto.CustomBindingExampleResponse; +import de.spring.webservices.client.auto.ExampleFault; +import de.spring.webservices.client.auto.ExampleRequest; +import de.spring.webservices.client.auto.ExampleResponse; +import de.spring.webservices.client.auto.Examples; +import de.spring.webservices.client.auto.ExamplesService; /** * Someone could write code like this one in order to send and receive @@ -29,7 +29,7 @@ public class ExampleClientService { this.webServiceTemplate = webServiceTemplate; } - public ExampleResponse sendAndReceiveJava() throws ExampleFault_Exception { + public ExampleResponse sendAndReceiveJava() throws ExampleFault { final ExampleRequest exampleRequest = new ExampleRequest(); exampleRequest.setData("SCARLETT JAVA. IT IS CANON."); @@ -49,7 +49,7 @@ public class ExampleClientService { return exampleResponse; } - public CustomBindingExampleResponse sendAndReceiveJavaCustom() throws CustomBindingExampleFault_Exception { + public CustomBindingExampleResponse sendAndReceiveJavaCustom() throws CustomBindingExampleFault { final CustomBindingExampleRequest customBindingxampleRequest = new CustomBindingExampleRequest(); customBindingxampleRequest.setData("CUSTOM BINDING JAVA. SCARLETT. IT IS CANON."); diff --git a/cxf/web-services-spring-cxf-client/src/main/java/de/spring/webservices/client/MainTest.java b/cxf/web-services-spring-cxf-client/src/main/java/de/spring/webservices/client/MainTest.java index c5d8e6f..8527ab5 100644 --- a/cxf/web-services-spring-cxf-client/src/main/java/de/spring/webservices/client/MainTest.java +++ b/cxf/web-services-spring-cxf-client/src/main/java/de/spring/webservices/client/MainTest.java @@ -5,10 +5,10 @@ import org.slf4j.LoggerFactory; import org.springframework.context.ApplicationContext; import org.springframework.context.support.ClassPathXmlApplicationContext; -import de.spring.webservices.auto.CustomBindingExampleFault_Exception; -import de.spring.webservices.auto.CustomBindingExampleResponse; -import de.spring.webservices.auto.ExampleFault_Exception; -import de.spring.webservices.auto.ExampleResponse; +import de.spring.webservices.client.auto.CustomBindingExampleFault; +import de.spring.webservices.client.auto.CustomBindingExampleResponse; +import de.spring.webservices.client.auto.ExampleFault; +import de.spring.webservices.client.auto.ExampleResponse; /** * This class is used just like a nice example about how to write and run client @@ -25,7 +25,7 @@ public class MainTest { * @throws ExampleFault_Exception * @throws CustomBindingExampleFault_Exception */ - public static void main(final String[] args) throws ExampleFault_Exception, CustomBindingExampleFault_Exception { + public static void main(final String[] args) throws ExampleFault, CustomBindingExampleFault { final MainTest test = new MainTest(); test.context = new ClassPathXmlApplicationContext( diff --git a/cxf/web-services-spring-cxf-client/src/main/resources/examples.xsd b/cxf/web-services-spring-cxf-client/src/main/resources/examples.xsd index e73313a..26cd175 100644 --- a/cxf/web-services-spring-cxf-client/src/main/resources/examples.xsd +++ b/cxf/web-services-spring-cxf-client/src/main/resources/examples.xsd @@ -62,14 +62,7 @@ - - - - - - - - + diff --git a/cxf/web-services-spring-cxf-client/src/main/resources/spring-configuration/ws/client-spring-configuration.xml b/cxf/web-services-spring-cxf-client/src/main/resources/spring-configuration/ws/client-spring-configuration.xml index b085d95..b701475 100644 --- a/cxf/web-services-spring-cxf-client/src/main/resources/spring-configuration/ws/client-spring-configuration.xml +++ b/cxf/web-services-spring-cxf-client/src/main/resources/spring-configuration/ws/client-spring-configuration.xml @@ -66,7 +66,12 @@ maven-jaxb2-plugin NO GENERA ESTOS OBJETOS pero maven-jaxb2-plugin NO ES BUENO PARA GENERAR CLASES DESDE WSDLs POR LAS RAZONES EXPLICADAS EN EL pom.xml DEL PROYECTO web-services-spring-jaxb2-client. --> - + + + + diff --git a/cxf/web-services-spring-cxf-client/src/test/java/de/spring/webservices/client/ExampleClientServiceIntegrationTest.java b/cxf/web-services-spring-cxf-client/src/test/java/de/spring/webservices/client/ExampleClientServiceIntegrationTest.java index a536c47..4877a5d 100644 --- a/cxf/web-services-spring-cxf-client/src/test/java/de/spring/webservices/client/ExampleClientServiceIntegrationTest.java +++ b/cxf/web-services-spring-cxf-client/src/test/java/de/spring/webservices/client/ExampleClientServiceIntegrationTest.java @@ -16,8 +16,8 @@ import org.springframework.ws.client.core.WebServiceTemplate; import org.springframework.ws.test.client.MockWebServiceServer; import org.springframework.xml.transform.StringSource; -import de.spring.webservices.auto.CustomBindingExampleResponse; -import de.spring.webservices.auto.ExampleResponse; +import de.spring.webservices.client.auto.CustomBindingExampleResponse; +import de.spring.webservices.client.auto.ExampleResponse; @RunWith(SpringJUnit4ClassRunner.class) diff --git a/cxf/web-services-spring-cxf-globalxsds/pom.xml b/cxf/web-services-spring-cxf-globalxsds/pom.xml index 691a780..ef09daf 100644 --- a/cxf/web-services-spring-cxf-globalxsds/pom.xml +++ b/cxf/web-services-spring-cxf-globalxsds/pom.xml @@ -13,7 +13,7 @@ src/main/resources ${basedir}/target/generated-sources/src/main/java - de.spring.webservices.auto + de.spring.webservices.parent.auto src/main/build-resources/bindings diff --git a/cxf/web-services-spring-cxf-globalxsds/src/main/resources/parent.xsd b/cxf/web-services-spring-cxf-globalxsds/src/main/resources/parent.xsd index 46f6550..c5801a6 100644 --- a/cxf/web-services-spring-cxf-globalxsds/src/main/resources/parent.xsd +++ b/cxf/web-services-spring-cxf-globalxsds/src/main/resources/parent.xsd @@ -35,5 +35,12 @@ + + + + + + + diff --git a/cxf/web-services-spring-cxf-server/pom.xml b/cxf/web-services-spring-cxf-server/pom.xml index d9fa313..1038489 100644 --- a/cxf/web-services-spring-cxf-server/pom.xml +++ b/cxf/web-services-spring-cxf-server/pom.xml @@ -15,7 +15,7 @@ 9.3.0.RC0 src/main/resources ${basedir}/target/generated-sources/src/main/java - de.spring.webservices.auto + de.spring.webservices.server.auto src/main/build-resources/bindings ${basedir}/src/main/build-resources/catalogs diff --git a/cxf/web-services-spring-cxf-server/src/main/java/de/spring/webservices/endpoints/ExampleEndPoint.java b/cxf/web-services-spring-cxf-server/src/main/java/de/spring/webservices/endpoints/ExampleEndPoint.java index 8fb4e40..e3e8da6 100644 --- a/cxf/web-services-spring-cxf-server/src/main/java/de/spring/webservices/endpoints/ExampleEndPoint.java +++ b/cxf/web-services-spring-cxf-server/src/main/java/de/spring/webservices/endpoints/ExampleEndPoint.java @@ -8,12 +8,12 @@ import org.springframework.ws.server.endpoint.annotation.PayloadRoot; import org.springframework.ws.server.endpoint.annotation.RequestPayload; import org.springframework.ws.server.endpoint.annotation.ResponsePayload; -import de.spring.webservices.auto.CustomBindingExampleRequest; -import de.spring.webservices.auto.CustomBindingExampleResponse; -import de.spring.webservices.auto.ExampleRequest; -import de.spring.webservices.auto.ExampleResponse; import de.spring.webservices.operations.Operations; import de.spring.webservices.operations.Operations.RequestResponse; +import de.spring.webservices.server.auto.CustomBindingExampleRequest; +import de.spring.webservices.server.auto.CustomBindingExampleResponse; +import de.spring.webservices.server.auto.ExampleRequest; +import de.spring.webservices.server.auto.ExampleResponse; import de.spring.webservices.services.ExampleService; diff --git a/cxf/web-services-spring-cxf-server/src/main/java/de/spring/webservices/endpoints/MyCustomMappingExceptionResolver.java b/cxf/web-services-spring-cxf-server/src/main/java/de/spring/webservices/endpoints/MyCustomMappingExceptionResolver.java index f07d42e..9d05061 100644 --- a/cxf/web-services-spring-cxf-server/src/main/java/de/spring/webservices/endpoints/MyCustomMappingExceptionResolver.java +++ b/cxf/web-services-spring-cxf-server/src/main/java/de/spring/webservices/endpoints/MyCustomMappingExceptionResolver.java @@ -19,9 +19,9 @@ import org.springframework.ws.soap.server.endpoint.AbstractSoapFaultDefinitionEx import org.springframework.ws.soap.server.endpoint.SoapFaultDefinition; import org.springframework.ws.soap.server.endpoint.SoapFaultDefinitionEditor; -import de.spring.webservices.auto.Element; -import de.spring.webservices.auto.ExampleFault; import de.spring.webservices.exceptions.CustomBusinessException; +import de.spring.webservices.server.auto.Element; +import de.spring.webservices.server.auto.GeneralFault; public class MyCustomMappingExceptionResolver extends AbstractSoapFaultDefinitionExceptionResolver { private static final Logger LOGGER = LoggerFactory.getLogger(MyCustomMappingExceptionResolver.class); @@ -94,7 +94,7 @@ public class MyCustomMappingExceptionResolver extends AbstractSoapFaultDefinitio } protected void customizeFault(Object endpoint, Exception ex, SoapFault fault) { - ExampleFault customFault = new ExampleFault(); + GeneralFault customFault = new GeneralFault(); customFault.setTechnicalError(getStackTrace(ex)); Element element = buildElement(ex); diff --git a/cxf/web-services-spring-cxf-server/src/main/java/de/spring/webservices/services/ExampleService.java b/cxf/web-services-spring-cxf-server/src/main/java/de/spring/webservices/services/ExampleService.java index 9d7eb79..881be73 100644 --- a/cxf/web-services-spring-cxf-server/src/main/java/de/spring/webservices/services/ExampleService.java +++ b/cxf/web-services-spring-cxf-server/src/main/java/de/spring/webservices/services/ExampleService.java @@ -1,7 +1,7 @@ package de.spring.webservices.services; -import de.spring.webservices.auto.ExampleRequest; -import de.spring.webservices.auto.ExampleResponse; +import de.spring.webservices.server.auto.ExampleRequest; +import de.spring.webservices.server.auto.ExampleResponse; public interface ExampleService { diff --git a/cxf/web-services-spring-cxf-server/src/main/java/de/spring/webservices/services/impl/CustomBindingExampleServiceImpl.java b/cxf/web-services-spring-cxf-server/src/main/java/de/spring/webservices/services/impl/CustomBindingExampleServiceImpl.java index 9863bae..0247a3f 100644 --- a/cxf/web-services-spring-cxf-server/src/main/java/de/spring/webservices/services/impl/CustomBindingExampleServiceImpl.java +++ b/cxf/web-services-spring-cxf-server/src/main/java/de/spring/webservices/services/impl/CustomBindingExampleServiceImpl.java @@ -5,14 +5,12 @@ package de.spring.webservices.services.impl; import org.springframework.stereotype.Service; - - +import de.spring.webservices.operations.Operations; +import de.spring.webservices.server.auto.CustomBindingExampleRequest; +import de.spring.webservices.server.auto.CustomBindingExampleResponse; +import de.spring.webservices.server.auto.ParentEnumType; //import de.spring.webservices.exceptions.BusinessException; //import de.spring.webservices.exceptions.CustomBusinessException; -import de.spring.webservices.auto.CustomBindingExampleRequest; -import de.spring.webservices.auto.CustomBindingExampleResponse; -import de.spring.webservices.auto.ParentEnumType; -import de.spring.webservices.operations.Operations; @Service("customBindingExampleService") diff --git a/cxf/web-services-spring-cxf-server/src/main/java/de/spring/webservices/services/impl/ExampleServiceImpl.java b/cxf/web-services-spring-cxf-server/src/main/java/de/spring/webservices/services/impl/ExampleServiceImpl.java index 7037776..ec80b60 100644 --- a/cxf/web-services-spring-cxf-server/src/main/java/de/spring/webservices/services/impl/ExampleServiceImpl.java +++ b/cxf/web-services-spring-cxf-server/src/main/java/de/spring/webservices/services/impl/ExampleServiceImpl.java @@ -2,8 +2,8 @@ package de.spring.webservices.services.impl; import org.springframework.stereotype.Service; -import de.spring.webservices.auto.ExampleRequest; -import de.spring.webservices.auto.ExampleResponse; +import de.spring.webservices.server.auto.ExampleRequest; +import de.spring.webservices.server.auto.ExampleResponse; import de.spring.webservices.services.ExampleService; diff --git a/cxf/web-services-spring-cxf-server/src/main/resources/examples.xsd b/cxf/web-services-spring-cxf-server/src/main/resources/examples.xsd index e73313a..26cd175 100644 --- a/cxf/web-services-spring-cxf-server/src/main/resources/examples.xsd +++ b/cxf/web-services-spring-cxf-server/src/main/resources/examples.xsd @@ -62,14 +62,7 @@ - - - - - - - - + diff --git a/cxf/web-services-spring-cxf-server/src/main/resources/spring-configuration/ws/soap-ws.xml b/cxf/web-services-spring-cxf-server/src/main/resources/spring-configuration/ws/soap-ws.xml index 6dd10fc..dba53c4 100644 --- a/cxf/web-services-spring-cxf-server/src/main/resources/spring-configuration/ws/soap-ws.xml +++ b/cxf/web-services-spring-cxf-server/src/main/resources/spring-configuration/ws/soap-ws.xml @@ -29,7 +29,7 @@ 2. Especificando el context-path para ser escaneado por Spring usando anotaciones. Esto se hace de este modo: - + Esto es lo mismo que haría Spring si no declaramos nada en el XML pero así tenemos opción de de especificar un context-path en concreto. @@ -40,7 +40,12 @@ en globalxsds (quizás incluso basado en el namespace del xsd) y así podría evitar esta configuración. --> - + + diff --git a/cxf/web-services-spring-cxf-server/src/test/java/de/spring/webservices/endpoints/ExampleEndPointTest.java b/cxf/web-services-spring-cxf-server/src/test/java/de/spring/webservices/endpoints/ExampleEndPointTest.java index 5b04c2f..a4a279f 100644 --- a/cxf/web-services-spring-cxf-server/src/test/java/de/spring/webservices/endpoints/ExampleEndPointTest.java +++ b/cxf/web-services-spring-cxf-server/src/test/java/de/spring/webservices/endpoints/ExampleEndPointTest.java @@ -6,10 +6,10 @@ import static org.mockito.Mockito.verify; import org.junit.Before; import org.junit.Test; -import de.spring.webservices.auto.CustomBindingExampleRequest; -import de.spring.webservices.auto.CustomBindingExampleResponse; -import de.spring.webservices.auto.ExampleRequest; import de.spring.webservices.operations.Operations; +import de.spring.webservices.server.auto.CustomBindingExampleRequest; +import de.spring.webservices.server.auto.CustomBindingExampleResponse; +import de.spring.webservices.server.auto.ExampleRequest; import de.spring.webservices.services.ExampleService; diff --git a/cxf/web-services-spring-cxf-server/src/test/java/de/spring/webservices/services/CustomBindingExampleServiceTest.java b/cxf/web-services-spring-cxf-server/src/test/java/de/spring/webservices/services/CustomBindingExampleServiceTest.java index a6d493b..d3b56be 100644 --- a/cxf/web-services-spring-cxf-server/src/test/java/de/spring/webservices/services/CustomBindingExampleServiceTest.java +++ b/cxf/web-services-spring-cxf-server/src/test/java/de/spring/webservices/services/CustomBindingExampleServiceTest.java @@ -4,9 +4,9 @@ import org.junit.Assert; import org.junit.Before; import org.junit.Test; -import de.spring.webservices.auto.CustomBindingExampleRequest; -import de.spring.webservices.auto.CustomBindingExampleResponse; import de.spring.webservices.operations.Operations; +import de.spring.webservices.server.auto.CustomBindingExampleRequest; +import de.spring.webservices.server.auto.CustomBindingExampleResponse; import de.spring.webservices.services.impl.CustomBindingExampleServiceImpl; diff --git a/cxf/web-services-spring-cxf-server/src/test/java/de/spring/webservices/services/ExampleServiceTest.java b/cxf/web-services-spring-cxf-server/src/test/java/de/spring/webservices/services/ExampleServiceTest.java index 493c76d..9f33c5e 100644 --- a/cxf/web-services-spring-cxf-server/src/test/java/de/spring/webservices/services/ExampleServiceTest.java +++ b/cxf/web-services-spring-cxf-server/src/test/java/de/spring/webservices/services/ExampleServiceTest.java @@ -4,8 +4,8 @@ import org.junit.Assert; import org.junit.Before; import org.junit.Test; -import de.spring.webservices.auto.ExampleRequest; -import de.spring.webservices.auto.ExampleResponse; +import de.spring.webservices.server.auto.ExampleRequest; +import de.spring.webservices.server.auto.ExampleResponse; import de.spring.webservices.services.impl.ExampleServiceImpl; public class ExampleServiceTest { diff --git a/jaxb2/web-services-spring-jaxb2-client/pom.xml b/jaxb2/web-services-spring-jaxb2-client/pom.xml index ca1f3f8..9bd8253 100644 --- a/jaxb2/web-services-spring-jaxb2-client/pom.xml +++ b/jaxb2/web-services-spring-jaxb2-client/pom.xml @@ -13,7 +13,7 @@ src/main/build-resources/wsdl ${project.build.directory}/generated-sources/src/main/java - de.spring.webservices.auto + de.spring.webservices.client.auto src/main/build-resources/bindings diff --git a/jaxb2/web-services-spring-jaxb2-client/src/main/build-resources/wsdl/example.wsdl b/jaxb2/web-services-spring-jaxb2-client/src/main/build-resources/wsdl/example.wsdl index 368eb3b..374ed46 100644 --- a/jaxb2/web-services-spring-jaxb2-client/src/main/build-resources/wsdl/example.wsdl +++ b/jaxb2/web-services-spring-jaxb2-client/src/main/build-resources/wsdl/example.wsdl @@ -54,14 +54,7 @@ - - - - - - - - + diff --git a/jaxb2/web-services-spring-jaxb2-client/src/main/java/de/spring/webservices/client/ExampleClientService.java b/jaxb2/web-services-spring-jaxb2-client/src/main/java/de/spring/webservices/client/ExampleClientService.java index 25179d9..f8bad46 100644 --- a/jaxb2/web-services-spring-jaxb2-client/src/main/java/de/spring/webservices/client/ExampleClientService.java +++ b/jaxb2/web-services-spring-jaxb2-client/src/main/java/de/spring/webservices/client/ExampleClientService.java @@ -4,13 +4,13 @@ import org.springframework.beans.factory.annotation.Autowired; import org.springframework.stereotype.Service; import org.springframework.ws.client.core.WebServiceTemplate; -import de.spring.webservices.auto.CustomBindingExampleRequest; -import de.spring.webservices.auto.CustomBindingExampleResponse; -import de.spring.webservices.auto.ExampleRequest; -import de.spring.webservices.auto.ExampleResponse; -//import de.spring.webservices.auto.Examples; -//import de.spring.webservices.auto.ExamplesService; -//import de.spring.webservices.auto.ParentEnumType; +import de.spring.webservices.client.auto.CustomBindingExampleRequest; +import de.spring.webservices.client.auto.CustomBindingExampleResponse; +import de.spring.webservices.client.auto.ExampleRequest; +import de.spring.webservices.client.auto.ExampleResponse; +//import de.spring.webservices.client.auto.Examples; +//import de.spring.webservices.client.auto.ExamplesService; +//import de.spring.webservices.client.auto.ParentEnumType; /** * Someone could write code like this one in order to send and receive diff --git a/jaxb2/web-services-spring-jaxb2-client/src/main/java/de/spring/webservices/client/MainTest.java b/jaxb2/web-services-spring-jaxb2-client/src/main/java/de/spring/webservices/client/MainTest.java index 36f5de4..8d79220 100644 --- a/jaxb2/web-services-spring-jaxb2-client/src/main/java/de/spring/webservices/client/MainTest.java +++ b/jaxb2/web-services-spring-jaxb2-client/src/main/java/de/spring/webservices/client/MainTest.java @@ -5,8 +5,8 @@ import org.slf4j.LoggerFactory; import org.springframework.context.ApplicationContext; import org.springframework.context.support.ClassPathXmlApplicationContext; -import de.spring.webservices.auto.CustomBindingExampleResponse; -import de.spring.webservices.auto.ExampleResponse; +import de.spring.webservices.client.auto.CustomBindingExampleResponse; +import de.spring.webservices.client.auto.ExampleResponse; /** * This class is used just like a nice example about how to write and run client diff --git a/jaxb2/web-services-spring-jaxb2-client/src/main/resources/schemas/examples.xsd b/jaxb2/web-services-spring-jaxb2-client/src/main/resources/schemas/examples.xsd index e73313a..26cd175 100644 --- a/jaxb2/web-services-spring-jaxb2-client/src/main/resources/schemas/examples.xsd +++ b/jaxb2/web-services-spring-jaxb2-client/src/main/resources/schemas/examples.xsd @@ -62,14 +62,7 @@ - - - - - - - - + diff --git a/jaxb2/web-services-spring-jaxb2-client/src/main/resources/spring-configuration/ws/client-spring-configuration.xml b/jaxb2/web-services-spring-jaxb2-client/src/main/resources/spring-configuration/ws/client-spring-configuration.xml index 985c5ad..cd67e3e 100644 --- a/jaxb2/web-services-spring-jaxb2-client/src/main/resources/spring-configuration/ws/client-spring-configuration.xml +++ b/jaxb2/web-services-spring-jaxb2-client/src/main/resources/spring-configuration/ws/client-spring-configuration.xml @@ -49,7 +49,12 @@ en globalxsds (quizás incluso basado en el namespace del xsd) y así podría evitar esta configuración. --> - + + diff --git a/jaxb2/web-services-spring-jaxb2-client/src/test/java/de/spring/webservices/client/ExampleClientServiceIntegrationTest.java b/jaxb2/web-services-spring-jaxb2-client/src/test/java/de/spring/webservices/client/ExampleClientServiceIntegrationTest.java index a536c47..4877a5d 100644 --- a/jaxb2/web-services-spring-jaxb2-client/src/test/java/de/spring/webservices/client/ExampleClientServiceIntegrationTest.java +++ b/jaxb2/web-services-spring-jaxb2-client/src/test/java/de/spring/webservices/client/ExampleClientServiceIntegrationTest.java @@ -16,8 +16,8 @@ import org.springframework.ws.client.core.WebServiceTemplate; import org.springframework.ws.test.client.MockWebServiceServer; import org.springframework.xml.transform.StringSource; -import de.spring.webservices.auto.CustomBindingExampleResponse; -import de.spring.webservices.auto.ExampleResponse; +import de.spring.webservices.client.auto.CustomBindingExampleResponse; +import de.spring.webservices.client.auto.ExampleResponse; @RunWith(SpringJUnit4ClassRunner.class) diff --git a/jaxb2/web-services-spring-jaxb2-globalxsds/pom.xml b/jaxb2/web-services-spring-jaxb2-globalxsds/pom.xml index b577d57..35278a9 100644 --- a/jaxb2/web-services-spring-jaxb2-globalxsds/pom.xml +++ b/jaxb2/web-services-spring-jaxb2-globalxsds/pom.xml @@ -13,7 +13,7 @@ src/main/resources/schemas ${project.build.directory}/generated-sources/src/main/java - de.spring.webservices.auto + de.spring.webservices.parent.auto src/main/build-resources/bindings diff --git a/jaxb2/web-services-spring-jaxb2-globalxsds/src/main/resources/schemas/parent.xsd b/jaxb2/web-services-spring-jaxb2-globalxsds/src/main/resources/schemas/parent.xsd index 46f6550..c5801a6 100644 --- a/jaxb2/web-services-spring-jaxb2-globalxsds/src/main/resources/schemas/parent.xsd +++ b/jaxb2/web-services-spring-jaxb2-globalxsds/src/main/resources/schemas/parent.xsd @@ -35,5 +35,12 @@ + + + + + + + diff --git a/jaxb2/web-services-spring-jaxb2-server/pom.xml b/jaxb2/web-services-spring-jaxb2-server/pom.xml index 6f44f97..fd5de7c 100644 --- a/jaxb2/web-services-spring-jaxb2-server/pom.xml +++ b/jaxb2/web-services-spring-jaxb2-server/pom.xml @@ -15,7 +15,7 @@ 9.3.0.RC0 src/main/resources/schemas ${project.build.directory}/generated-sources/src/main/java - de.spring.webservices.auto + de.spring.webservices.server.auto src/main/build-resources/bindings diff --git a/jaxb2/web-services-spring-jaxb2-server/src/main/java/de/spring/webservices/endpoints/ExampleEndPoint.java b/jaxb2/web-services-spring-jaxb2-server/src/main/java/de/spring/webservices/endpoints/ExampleEndPoint.java index 8fb4e40..e3e8da6 100644 --- a/jaxb2/web-services-spring-jaxb2-server/src/main/java/de/spring/webservices/endpoints/ExampleEndPoint.java +++ b/jaxb2/web-services-spring-jaxb2-server/src/main/java/de/spring/webservices/endpoints/ExampleEndPoint.java @@ -8,12 +8,12 @@ import org.springframework.ws.server.endpoint.annotation.PayloadRoot; import org.springframework.ws.server.endpoint.annotation.RequestPayload; import org.springframework.ws.server.endpoint.annotation.ResponsePayload; -import de.spring.webservices.auto.CustomBindingExampleRequest; -import de.spring.webservices.auto.CustomBindingExampleResponse; -import de.spring.webservices.auto.ExampleRequest; -import de.spring.webservices.auto.ExampleResponse; import de.spring.webservices.operations.Operations; import de.spring.webservices.operations.Operations.RequestResponse; +import de.spring.webservices.server.auto.CustomBindingExampleRequest; +import de.spring.webservices.server.auto.CustomBindingExampleResponse; +import de.spring.webservices.server.auto.ExampleRequest; +import de.spring.webservices.server.auto.ExampleResponse; import de.spring.webservices.services.ExampleService; diff --git a/jaxb2/web-services-spring-jaxb2-server/src/main/java/de/spring/webservices/endpoints/MyCustomMappingExceptionResolver.java b/jaxb2/web-services-spring-jaxb2-server/src/main/java/de/spring/webservices/endpoints/MyCustomMappingExceptionResolver.java index f07d42e..382cd74 100644 --- a/jaxb2/web-services-spring-jaxb2-server/src/main/java/de/spring/webservices/endpoints/MyCustomMappingExceptionResolver.java +++ b/jaxb2/web-services-spring-jaxb2-server/src/main/java/de/spring/webservices/endpoints/MyCustomMappingExceptionResolver.java @@ -19,9 +19,9 @@ import org.springframework.ws.soap.server.endpoint.AbstractSoapFaultDefinitionEx import org.springframework.ws.soap.server.endpoint.SoapFaultDefinition; import org.springframework.ws.soap.server.endpoint.SoapFaultDefinitionEditor; -import de.spring.webservices.auto.Element; -import de.spring.webservices.auto.ExampleFault; import de.spring.webservices.exceptions.CustomBusinessException; +import de.spring.webservices.parent.auto.Element; +import de.spring.webservices.parent.auto.GeneralFault; public class MyCustomMappingExceptionResolver extends AbstractSoapFaultDefinitionExceptionResolver { private static final Logger LOGGER = LoggerFactory.getLogger(MyCustomMappingExceptionResolver.class); @@ -94,7 +94,7 @@ public class MyCustomMappingExceptionResolver extends AbstractSoapFaultDefinitio } protected void customizeFault(Object endpoint, Exception ex, SoapFault fault) { - ExampleFault customFault = new ExampleFault(); + GeneralFault customFault = new GeneralFault(); customFault.setTechnicalError(getStackTrace(ex)); Element element = buildElement(ex); diff --git a/jaxb2/web-services-spring-jaxb2-server/src/main/java/de/spring/webservices/services/ExampleService.java b/jaxb2/web-services-spring-jaxb2-server/src/main/java/de/spring/webservices/services/ExampleService.java index 9d7eb79..881be73 100644 --- a/jaxb2/web-services-spring-jaxb2-server/src/main/java/de/spring/webservices/services/ExampleService.java +++ b/jaxb2/web-services-spring-jaxb2-server/src/main/java/de/spring/webservices/services/ExampleService.java @@ -1,7 +1,7 @@ package de.spring.webservices.services; -import de.spring.webservices.auto.ExampleRequest; -import de.spring.webservices.auto.ExampleResponse; +import de.spring.webservices.server.auto.ExampleRequest; +import de.spring.webservices.server.auto.ExampleResponse; public interface ExampleService { diff --git a/jaxb2/web-services-spring-jaxb2-server/src/main/java/de/spring/webservices/services/impl/CustomBindingExampleServiceImpl.java b/jaxb2/web-services-spring-jaxb2-server/src/main/java/de/spring/webservices/services/impl/CustomBindingExampleServiceImpl.java index 9863bae..88424b2 100644 --- a/jaxb2/web-services-spring-jaxb2-server/src/main/java/de/spring/webservices/services/impl/CustomBindingExampleServiceImpl.java +++ b/jaxb2/web-services-spring-jaxb2-server/src/main/java/de/spring/webservices/services/impl/CustomBindingExampleServiceImpl.java @@ -5,14 +5,12 @@ package de.spring.webservices.services.impl; import org.springframework.stereotype.Service; - - +import de.spring.webservices.operations.Operations; +import de.spring.webservices.parent.auto.ParentEnumType; +import de.spring.webservices.server.auto.CustomBindingExampleRequest; +import de.spring.webservices.server.auto.CustomBindingExampleResponse; //import de.spring.webservices.exceptions.BusinessException; //import de.spring.webservices.exceptions.CustomBusinessException; -import de.spring.webservices.auto.CustomBindingExampleRequest; -import de.spring.webservices.auto.CustomBindingExampleResponse; -import de.spring.webservices.auto.ParentEnumType; -import de.spring.webservices.operations.Operations; @Service("customBindingExampleService") diff --git a/jaxb2/web-services-spring-jaxb2-server/src/main/java/de/spring/webservices/services/impl/ExampleServiceImpl.java b/jaxb2/web-services-spring-jaxb2-server/src/main/java/de/spring/webservices/services/impl/ExampleServiceImpl.java index 7037776..ec80b60 100644 --- a/jaxb2/web-services-spring-jaxb2-server/src/main/java/de/spring/webservices/services/impl/ExampleServiceImpl.java +++ b/jaxb2/web-services-spring-jaxb2-server/src/main/java/de/spring/webservices/services/impl/ExampleServiceImpl.java @@ -2,8 +2,8 @@ package de.spring.webservices.services.impl; import org.springframework.stereotype.Service; -import de.spring.webservices.auto.ExampleRequest; -import de.spring.webservices.auto.ExampleResponse; +import de.spring.webservices.server.auto.ExampleRequest; +import de.spring.webservices.server.auto.ExampleResponse; import de.spring.webservices.services.ExampleService; diff --git a/jaxb2/web-services-spring-jaxb2-server/src/main/resources/schemas/examples.xsd b/jaxb2/web-services-spring-jaxb2-server/src/main/resources/schemas/examples.xsd index e73313a..26cd175 100644 --- a/jaxb2/web-services-spring-jaxb2-server/src/main/resources/schemas/examples.xsd +++ b/jaxb2/web-services-spring-jaxb2-server/src/main/resources/schemas/examples.xsd @@ -62,14 +62,7 @@ - - - - - - - - + diff --git a/jaxb2/web-services-spring-jaxb2-server/src/main/resources/spring-configuration/ws/soap-ws.xml b/jaxb2/web-services-spring-jaxb2-server/src/main/resources/spring-configuration/ws/soap-ws.xml index d3b562b..601b57b 100644 --- a/jaxb2/web-services-spring-jaxb2-server/src/main/resources/spring-configuration/ws/soap-ws.xml +++ b/jaxb2/web-services-spring-jaxb2-server/src/main/resources/spring-configuration/ws/soap-ws.xml @@ -29,7 +29,7 @@ 2. Especificando el context-path para ser escaneado por Spring usando anotaciones. Esto se hace de este modo: - + Esto es lo mismo que haría Spring si no declaramos nada en el XML pero así tenemos opción de de especificar un context-path en concreto. @@ -40,7 +40,12 @@ en globalxsds (quizás incluso basado en el namespace del xsd) y así podría evitar esta configuración. --> - + + diff --git a/jaxb2/web-services-spring-jaxb2-server/src/test/java/de/spring/webservices/endpoints/ExampleEndPointTest.java b/jaxb2/web-services-spring-jaxb2-server/src/test/java/de/spring/webservices/endpoints/ExampleEndPointTest.java index 5b04c2f..a4a279f 100644 --- a/jaxb2/web-services-spring-jaxb2-server/src/test/java/de/spring/webservices/endpoints/ExampleEndPointTest.java +++ b/jaxb2/web-services-spring-jaxb2-server/src/test/java/de/spring/webservices/endpoints/ExampleEndPointTest.java @@ -6,10 +6,10 @@ import static org.mockito.Mockito.verify; import org.junit.Before; import org.junit.Test; -import de.spring.webservices.auto.CustomBindingExampleRequest; -import de.spring.webservices.auto.CustomBindingExampleResponse; -import de.spring.webservices.auto.ExampleRequest; import de.spring.webservices.operations.Operations; +import de.spring.webservices.server.auto.CustomBindingExampleRequest; +import de.spring.webservices.server.auto.CustomBindingExampleResponse; +import de.spring.webservices.server.auto.ExampleRequest; import de.spring.webservices.services.ExampleService; diff --git a/jaxb2/web-services-spring-jaxb2-server/src/test/java/de/spring/webservices/services/CustomBindingExampleServiceTest.java b/jaxb2/web-services-spring-jaxb2-server/src/test/java/de/spring/webservices/services/CustomBindingExampleServiceTest.java index a6d493b..d3b56be 100644 --- a/jaxb2/web-services-spring-jaxb2-server/src/test/java/de/spring/webservices/services/CustomBindingExampleServiceTest.java +++ b/jaxb2/web-services-spring-jaxb2-server/src/test/java/de/spring/webservices/services/CustomBindingExampleServiceTest.java @@ -4,9 +4,9 @@ import org.junit.Assert; import org.junit.Before; import org.junit.Test; -import de.spring.webservices.auto.CustomBindingExampleRequest; -import de.spring.webservices.auto.CustomBindingExampleResponse; import de.spring.webservices.operations.Operations; +import de.spring.webservices.server.auto.CustomBindingExampleRequest; +import de.spring.webservices.server.auto.CustomBindingExampleResponse; import de.spring.webservices.services.impl.CustomBindingExampleServiceImpl; diff --git a/jaxb2/web-services-spring-jaxb2-server/src/test/java/de/spring/webservices/services/ExampleServiceTest.java b/jaxb2/web-services-spring-jaxb2-server/src/test/java/de/spring/webservices/services/ExampleServiceTest.java index 493c76d..9f33c5e 100644 --- a/jaxb2/web-services-spring-jaxb2-server/src/test/java/de/spring/webservices/services/ExampleServiceTest.java +++ b/jaxb2/web-services-spring-jaxb2-server/src/test/java/de/spring/webservices/services/ExampleServiceTest.java @@ -4,8 +4,8 @@ import org.junit.Assert; import org.junit.Before; import org.junit.Test; -import de.spring.webservices.auto.ExampleRequest; -import de.spring.webservices.auto.ExampleResponse; +import de.spring.webservices.server.auto.ExampleRequest; +import de.spring.webservices.server.auto.ExampleResponse; import de.spring.webservices.services.impl.ExampleServiceImpl; public class ExampleServiceTest { -- 2.1.4