From d086864a96c3f777ca2f0218ce25b373708279b6 Mon Sep 17 00:00:00 2001 From: Gustavo Martin Morcuende Date: Wed, 16 Dec 2015 00:57:05 +0100 Subject: [PATCH] jaxb2: jaxws:bindings not available with maven-jaxb2-plugin neither @WebService, @WebServiceClient and @WebEndpoint --- jaxb2/web-services-spring-jaxb2-client/pom.xml | 401 +++++++++++---------- .../build-resources/bindings/custombinding.xjb | 50 --- .../src/main/build-resources/catalogs/catalog.cat | 44 +-- .../webservices/client/ExampleClientService.java | 51 +-- .../de/spring/webservices/client/MainTest.java | 17 +- jaxb2/web-services-spring-jaxb2-server/pom.xml | 2 +- .../resources/spring-configuration/ws/soap-ws.xml | 2 +- 7 files changed, 264 insertions(+), 303 deletions(-) delete mode 100644 jaxb2/web-services-spring-jaxb2-client/src/main/build-resources/bindings/custombinding.xjb diff --git a/jaxb2/web-services-spring-jaxb2-client/pom.xml b/jaxb2/web-services-spring-jaxb2-client/pom.xml index a70061d..11163e7 100644 --- a/jaxb2/web-services-spring-jaxb2-client/pom.xml +++ b/jaxb2/web-services-spring-jaxb2-client/pom.xml @@ -1,184 +1,219 @@ - - 4.0.0 - - web-services-spring-jaxb2 - de.spring.webservices - 1.0-SNAPSHOT - - web-services-spring-jaxb2-client - web-services-spring-jaxb2-client - http://gumartinm.name - - - src/main/build-resources/wsdl - ${basedir}/target/generated-sources/src/main/java - src/main/build-resources/bindings - - ${basedir}/src/main/build-resources/catalogs - - - - - org.springframework.ws - spring-ws-core - - - org.springframework.ws - spring-xml - - - org.jdom - jdom - - - - - - de.spring.webservices - web-services-spring-jaxb2-globalxsds - ${project.version} - - - - - - wsdl4j - wsdl4j - - - - - org.jvnet.jaxb2_commons - jaxb2-basics-runtime - 0.9.4 - - - - - junit - junit - test - - - org.springframework - spring-test - test - - - org.springframework.ws - spring-ws-test - test - - - - - ${project.artifactId} - - - ${basedir}/src/main/resources/ - - **/*.* - - - - - - - org.apache.cxf - cxf-codegen-plugin - 3.1.0 - - - generate-sources-from-wsdl - generate-sources - - wsdl2java - - - true - ${project.wsdl.target.path} - - - - ${project.wsdl.sources.path}/example.wsdl - - ${project.bindings.path}/custombinding.xjb - - - -xjc-Xinheritance - -xjc-Xannotate - -catalog - ${project.catalogs.path}/catalog.cat - -verbose - - - - - - - - - - org.jvnet.jaxb2_commons - jaxb2-basics - 0.9.4 - - - - - org.jvnet.jaxb2_commons - jaxb2-basics-annotate - 1.0.1 - - - - - org.codehaus.mojo - build-helper-maven-plugin - 1.9.1 - - - add-source - generate-sources - - add-source - - - - ${project.wsdl.target.path} - - - - - - - - + + 4.0.0 + + web-services-spring-jaxb2 + de.spring.webservices + 1.0-SNAPSHOT + + web-services-spring-jaxb2-client + web-services-spring-jaxb2-client + http://gumartinm.name + + + src/main/build-resources/wsdl + ${project.build.directory}/generated-sources/src/main/java + de.spring.webservices.auto + src/main/build-resources/bindings + + + + + org.springframework.ws + spring-ws-core + + + org.springframework.ws + spring-xml + + + org.jdom + jdom + + + + + + de.spring.webservices + web-services-spring-jaxb2-globalxsds + ${project.version} + + + + + + wsdl4j + wsdl4j + + + + + junit + junit + test + + + org.springframework + spring-test + test + + + org.springframework.ws + spring-ws-test + test + + + org.mockito + mockito-core + test + + + + + ${project.artifactId} + + + ${basedir}/src/main/resources/ + + **/*.* + + + + + + org.jvnet.jaxb2.maven2 + maven-jaxb2-plugin + 0.13.1 + + + generate-sources-from-xsd + + generate + + generate-sources + + + + + true + false + ${project.xsd.schemas.source.path + + + + + + + + + false + + + ${project.xsd.schemas.target.path} + + ${project.xsd.schemas.package.name} + + + true + + true + + + ${project.build.sourceEncoding} + + + en + + + true + false + + + false + + true + + true + + -Xinheritance + -Xannotate + + + + org.jvnet.jaxb2_commons + jaxb2-basics + 0.9.5 + + + org.jvnet.jaxb2_commons + jaxb2-basics-annotate + 1.0.2 + + + + + + + + false + src/main/build-resources/catalogs/catalog.cat + + + de.spring.webservices + web-services-spring-jaxb2-globalxsds + + + + + + + diff --git a/jaxb2/web-services-spring-jaxb2-client/src/main/build-resources/bindings/custombinding.xjb b/jaxb2/web-services-spring-jaxb2-client/src/main/build-resources/bindings/custombinding.xjb deleted file mode 100644 index 95e1fd2..0000000 --- a/jaxb2/web-services-spring-jaxb2-client/src/main/build-resources/bindings/custombinding.xjb +++ /dev/null @@ -1,50 +0,0 @@ - - - - - - - - - - - - - - - - - de.spring.webservices.operations.Request - @java.lang.suppresswarnings({"unchecked","rawtypes"}) - - - - de.spring.webservices.operations.Response - @java.lang.suppresswarnings({"unchecked","rawtypes"}) - - - - - - - - - diff --git a/jaxb2/web-services-spring-jaxb2-client/src/main/build-resources/catalogs/catalog.cat b/jaxb2/web-services-spring-jaxb2-client/src/main/build-resources/catalogs/catalog.cat index 4bc1c66..113acd0 100644 --- a/jaxb2/web-services-spring-jaxb2-client/src/main/build-resources/catalogs/catalog.cat +++ b/jaxb2/web-services-spring-jaxb2-client/src/main/build-resources/catalogs/catalog.cat @@ -1,38 +1,12 @@ - - - - - - - - - - - - - - - - - - - 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 177c13e..df603df 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 @@ -1,7 +1,5 @@ package de.spring.webservices.client; -import name.gumartinm.spring_ws.parent.ParentEnumType; - import org.springframework.beans.factory.annotation.Autowired; import org.springframework.ws.client.core.WebServiceTemplate; @@ -9,8 +7,9 @@ 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.Examples; +//import de.spring.webservices.auto.ExamplesService; +//import de.spring.webservices.auto.ParentEnumType; /** * Someone could write code like this one in order to send and receive @@ -25,15 +24,16 @@ public class ExampleClientService { this.webServiceTemplate = webServiceTemplate; } - public ExampleResponse sendAndReceiveJava() { - final ExampleRequest exampleRequest = new ExampleRequest(); - exampleRequest.setData("SCARLETT JAVA. IT IS CANON."); - - final Examples exampleService = new ExamplesService().getExamplesSoap12(); - final ExampleResponse exampleResponse = exampleService.example(exampleRequest); - - return exampleResponse; - } +// maven-jaxb2-plugin DOESN'T CREATE @WebService, @WebServiceClient y @WebEndpoint +// public ExampleResponse sendAndReceiveJava() { +// final ExampleRequest exampleRequest = new ExampleRequest(); +// exampleRequest.setData("SCARLETT JAVA. IT IS CANON."); +// +// final Examples exampleService = new ExamplesService().getExamplesSoap12(); +// final ExampleResponse exampleResponse = exampleService.example(exampleRequest); +// +// return exampleResponse; +// } public ExampleResponse sendAndReceiveSpring() { final ExampleRequest exampleRequest = new ExampleRequest(); @@ -45,18 +45,19 @@ public class ExampleClientService { return exampleResponse; } - public CustomBindingExampleResponse sendAndReceiveJavaCustom() { - final CustomBindingExampleRequest customBindingxampleRequest = - new CustomBindingExampleRequest(); - customBindingxampleRequest.setData("CUSTOM BINDING JAVA. SCARLETT. IT IS CANON."); - customBindingxampleRequest.setParentEnum(ParentEnumType.FIRST); - - final Examples exampleService = new ExamplesService().getExamplesSoap12(); - final CustomBindingExampleResponse customBindingExampleResponse = - exampleService.customBindingExample(customBindingxampleRequest); - - return customBindingExampleResponse; - } +// maven-jaxb2-plugin DOESN'T CREATE @WebService, @WebServiceClient y @WebEndpoint +// public CustomBindingExampleResponse sendAndReceiveJavaCustom() { +// final CustomBindingExampleRequest customBindingxampleRequest = +// new CustomBindingExampleRequest(); +// customBindingxampleRequest.setData("CUSTOM BINDING JAVA. SCARLETT. IT IS CANON."); +// customBindingxampleRequest.setParentEnum(ParentEnumType.FIRST); +// +// final Examples exampleService = new ExamplesService().getExamplesSoap12(); +// final CustomBindingExampleResponse customBindingExampleResponse = +// exampleService.customBindingExample(customBindingxampleRequest); +// +// return customBindingExampleResponse; +// } public CustomBindingExampleResponse sendAndReceiveSpringCustom() { final CustomBindingExampleRequest customBindingxampleRequest = 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 48fbdcd..a77f560 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 @@ -30,23 +30,24 @@ public class MainTest { final ExampleClientService example = (ExampleClientService) test.context.getBean("exampleClient"); - logger.info("ExampleResponse Java:"); - ExampleResponse response = example.sendAndReceiveJava(); - logger.info(response.getData()); +// maven-jaxb2-plugin DOESN'T CREATE @WebService, @WebServiceClient y @WebEndpoint +// logger.info("ExampleResponse Java:"); +// ExampleResponse response = example.sendAndReceiveJava(); +// logger.info(response.getData()); - logger.info("CustomBindingExampleResponse Java:"); - CustomBindingExampleResponse customBindingResponse = example.sendAndReceiveJavaCustom(); - logger.info(customBindingResponse.getData()); +// logger.info("CustomBindingExampleResponse Java:"); +// CustomBindingExampleResponse customBindingResponse = example.sendAndReceiveJavaCustom(); +// logger.info(customBindingResponse.getData()); logger.info("ExampleResponse Spring:"); - response = example.sendAndReceiveSpring(); + ExampleResponse response = example.sendAndReceiveSpring(); logger.info(response.getData()); logger.info("CustomBindingExampleResponse Spring:"); - customBindingResponse = example.sendAndReceiveSpringCustom(); + CustomBindingExampleResponse customBindingResponse = example.sendAndReceiveSpringCustom(); logger.info(customBindingResponse.getData()); } } diff --git a/jaxb2/web-services-spring-jaxb2-server/pom.xml b/jaxb2/web-services-spring-jaxb2-server/pom.xml index 0c0924d..e53bf45 100644 --- a/jaxb2/web-services-spring-jaxb2-server/pom.xml +++ b/jaxb2/web-services-spring-jaxb2-server/pom.xml @@ -174,7 +174,7 @@