From d086864a96c3f777ca2f0218ce25b373708279b6 Mon Sep 17 00:00:00 2001 From: Gustavo Martin Morcuende <gu.martinm@gmail.com> 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 @@ -<project xmlns="http://maven.apache.org/POM/4.0.0" - xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" - xsi:schemaLocation="http://maven.apache.org/POM/4.0.0 http://maven.apache.org/maven-v4_0_0.xsd"> - <modelVersion>4.0.0</modelVersion> - <parent> - <artifactId>web-services-spring-jaxb2</artifactId> - <groupId>de.spring.webservices</groupId> - <version>1.0-SNAPSHOT</version> - </parent> - <artifactId>web-services-spring-jaxb2-client</artifactId> - <name>web-services-spring-jaxb2-client</name> - <url>http://gumartinm.name</url> - - <properties> - <project.wsdl.sources.path>src/main/build-resources/wsdl</project.wsdl.sources.path> - <project.wsdl.target.path>${basedir}/target/generated-sources/src/main/java</project.wsdl.target.path> - <project.bindings.path>src/main/build-resources/bindings</project.bindings.path> - <!-- Requires absolute path (because of that I am using ${basedir} --> - <project.catalogs.path>${basedir}/src/main/build-resources/catalogs</project.catalogs.path> - </properties> - - <dependencies> - <dependency> - <groupId>org.springframework.ws</groupId> - <artifactId>spring-ws-core</artifactId> - </dependency> - <dependency> - <groupId>org.springframework.ws</groupId> - <artifactId>spring-xml</artifactId> - </dependency> - <dependency> - <groupId>org.jdom</groupId> - <artifactId>jdom</artifactId> - </dependency> - - - <!-- Global types --> - <dependency> - <groupId>de.spring.webservices</groupId> - <artifactId>web-services-spring-jaxb2-globalxsds</artifactId> - <version>${project.version}</version> - </dependency> - - - <!-- Required by spring-ws-core --> - <dependency> - <groupId>wsdl4j</groupId> - <artifactId>wsdl4j</artifactId> - </dependency> - - <!-- Required by jaxb2-basics as specified: - http://confluence.highsource.org/display/J2B/Using+JAXB2+Basics+Plugins+with+CXF - --> - <dependency> - <groupId>org.jvnet.jaxb2_commons</groupId> - <artifactId>jaxb2-basics-runtime</artifactId> - <version>0.9.4</version> - </dependency> - - <!-- Unitary and integration tests --> - <dependency> - <groupId>junit</groupId> - <artifactId>junit</artifactId> - <scope>test</scope> - </dependency> - <dependency> - <groupId>org.springframework</groupId> - <artifactId>spring-test</artifactId> - <scope>test</scope> - </dependency> - <dependency> - <groupId>org.springframework.ws</groupId> - <artifactId>spring-ws-test</artifactId> - <scope>test</scope> - </dependency> - </dependencies> - - <build> - <finalName>${project.artifactId}</finalName> - <resources> - <resource> - <directory>${basedir}/src/main/resources/</directory> - <includes> - <include>**/*.*</include> - </includes> - </resource> - </resources> - <plugins> - <!-- Generate code from wsdl files: - We could use maven-jaxb2-plugin in order to generate Java classes from WSDL files but - this plugin seems more useful so, I keep using it. Besides, it is based on Apache CXF which - as well, uses jaxb. - - See: http://cxf.apache.org/docs/maven-cxf-codegen-plugin-wsdl-to-java.html - --> - <plugin> - <groupId>org.apache.cxf</groupId> - <artifactId>cxf-codegen-plugin</artifactId> - <version>3.1.0</version> - <executions> - <execution> - <id>generate-sources-from-wsdl</id> - <phase>generate-sources</phase> - <goals> - <goal>wsdl2java</goal> - </goals> - <configuration> - <fork>true</fork> - <sourceRoot>${project.wsdl.target.path}</sourceRoot> - <wsdlOptions> - <wsdlOption> - <!-- - <wsdl>${project.wsdl.sources.path}/example.wsdl</wsdl> - --> - <wsdl>${project.wsdl.sources.path}/example.wsdl</wsdl> - <bindingFiles> - <bindingFile>${project.bindings.path}/custombinding.xjb</bindingFile> - </bindingFiles> - <extraargs> - <extraarg>-xjc-Xinheritance</extraarg> - <extraarg>-xjc-Xannotate</extraarg> - <extraarg>-catalog</extraarg> - <extraarg>${project.catalogs.path}/catalog.cat</extraarg> - <extraarg>-verbose</extraarg> - </extraargs> - </wsdlOption> - </wsdlOptions> - </configuration> - </execution> - </executions> - <dependencies> - <!-- We make this plugin work with this jaxb2 version. - This particular version let us generate inherited classes using - the -Xinheritance argument. - - DO NOT FORGET: We can use <inheritance:implements> in xsd files or by means - of custom bindings (see custombinding.xjb) This is useful when you may not modify - xsd files because they are generated by other person or machine. - --> - <dependency> - <groupId>org.jvnet.jaxb2_commons</groupId> - <artifactId>jaxb2-basics</artifactId> - <version>0.9.4</version> - </dependency> - - <!-- We make this plugin work with this jaxb2 version. - This particular version let us generate annotated classes using - the -Xannotate argument. - - DO NOT FORGET: We can use <annox:annotate> in xsd files or by means - of custom bindings like I did with <inheritance:implements> (see custombinding.xjb) - This is useful when you may not modify xsd files because they are generated - by other person or machine. - --> - <dependency> - <groupId>org.jvnet.jaxb2_commons</groupId> - <artifactId>jaxb2-basics-annotate</artifactId> - <version>1.0.1</version> - </dependency> - </dependencies> - </plugin> - <plugin> - <groupId>org.codehaus.mojo</groupId> - <artifactId>build-helper-maven-plugin</artifactId> - <version>1.9.1</version> - <executions> - <execution> - <id>add-source</id> - <phase>generate-sources</phase> - <goals> - <goal>add-source</goal> - </goals> - <configuration> - <sources> - <source>${project.wsdl.target.path}</source> - </sources> - </configuration> - </execution> - </executions> - </plugin> - </plugins> - </build> -</project> +<project xmlns="http://maven.apache.org/POM/4.0.0" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" + xsi:schemaLocation="http://maven.apache.org/POM/4.0.0 http://maven.apache.org/maven-v4_0_0.xsd"> + <modelVersion>4.0.0</modelVersion> + <parent> + <artifactId>web-services-spring-jaxb2</artifactId> + <groupId>de.spring.webservices</groupId> + <version>1.0-SNAPSHOT</version> + </parent> + <artifactId>web-services-spring-jaxb2-client</artifactId> + <name>web-services-spring-jaxb2-client</name> + <url>http://gumartinm.name</url> + + <properties> + <project.xsd.schemas.source.path>src/main/build-resources/wsdl</project.xsd.schemas.source.path> + <project.xsd.schemas.target.path>${project.build.directory}/generated-sources/src/main/java</project.xsd.schemas.target.path> + <project.xsd.schemas.package.name>de.spring.webservices.auto</project.xsd.schemas.package.name> + <project.bindings.path>src/main/build-resources/bindings</project.bindings.path> + </properties> + + <dependencies> + <dependency> + <groupId>org.springframework.ws</groupId> + <artifactId>spring-ws-core</artifactId> + </dependency> + <dependency> + <groupId>org.springframework.ws</groupId> + <artifactId>spring-xml</artifactId> + </dependency> + <dependency> + <groupId>org.jdom</groupId> + <artifactId>jdom</artifactId> + </dependency> + + + <!-- Global types --> + <dependency> + <groupId>de.spring.webservices</groupId> + <artifactId>web-services-spring-jaxb2-globalxsds</artifactId> + <version>${project.version}</version> + </dependency> + + + <!-- Required by spring-ws-core --> + <dependency> + <groupId>wsdl4j</groupId> + <artifactId>wsdl4j</artifactId> + </dependency> + + <!-- Unitary and integration tests --> + <dependency> + <groupId>junit</groupId> + <artifactId>junit</artifactId> + <scope>test</scope> + </dependency> + <dependency> + <groupId>org.springframework</groupId> + <artifactId>spring-test</artifactId> + <scope>test</scope> + </dependency> + <dependency> + <groupId>org.springframework.ws</groupId> + <artifactId>spring-ws-test</artifactId> + <scope>test</scope> + </dependency> + <dependency> + <groupId>org.mockito</groupId> + <artifactId>mockito-core</artifactId> + <scope>test</scope> + </dependency> + </dependencies> + + <build> + <finalName>${project.artifactId}</finalName> + <resources> + <resource> + <directory>${basedir}/src/main/resources/</directory> + <includes> + <include>**/*.*</include> + </includes> + </resource> + </resources> + <plugins> + <plugin> + <groupId>org.jvnet.jaxb2.maven2</groupId> + <artifactId>maven-jaxb2-plugin</artifactId> + <version>0.13.1</version> + <executions> + <execution> + <id>generate-sources-from-xsd</id> + <goals> + <goal>generate</goal> + </goals> + <phase>generate-sources</phase> + </execution> + </executions> + <configuration> + <!-- REQUIRED FOR USING THIS PLUGIN WITH WSDL FILES!!!!! --> + <wsdl>true</wsdl> + <xmlschema>false</xmlschema> + <schemaFiles>${project.xsd.schemas.source.path</schemaFiles> + + <!-- DOESN'T WORK FOR WSDL FILES!!!! + Specifies the schema directory, src/main/resources by default. + <schemaDirectory>${project.xsd.schemas.source.path}</schemaDirectory> + --> + + + <!-- + GRANDES DIFERENCIAS: + + :( CON ESTE PLUGIN A DIFERENCIA DE cxf-codegen-plugin NO SE PUEDEN USAR BINDINGS PARA WSDL + LLAMADOS jaxws:bindings :( ESTO PUEDE SER UN PROBLEMA SI SE QUIERE MODIFICAR EL WSDL PROPORCIONADO + POR ALGUIEN SIN TENER QUE EDITARLO :( POR EJEMPLO, AQUÃ YA NO PUEDO METER MI XSDateTimeCustomBinder + SIN EDITAR EL WSDL :( + + :) CON ESTE PLUGIN A DIFERENCIA DE cxf-codegen-plugin NO SE VUELVEN A GENERAR LOS OBJETOS DE parent.xsd + QUE SE ENCONTRABAN EN web-services-spring-jaxb2-globalxsds + + :( CON ESTE PLUGIN NO CONSIGO GENERAR LAS CLASES @WebService, @WebServiceClient y @WebEndpoint + CON cxf-codegen-plugin SÃ PUEDO :( VER ExamplesService EN web-services-spring-cxf-client + --> + + <!-- DOESN'T WORK FOR WSDL FILES!!!! + Specifies the binding directory, default to the schemaDirectory + <bindingDirectory>${project.bindings.path}</bindingDirectory> + --> + <!-- Do not scan for *.xjb files in dependencies --> + <scanDependenciesForBindings>false</scanDependenciesForBindings> + + <!-- Target directory for the generated code, target/generated-sources/xjc + by default. --> + <generateDirectory>${project.xsd.schemas.target.path}</generateDirectory> + <!-- The generated classes will all be placed under this Java package + (XJC's -p option), unless otherwise specified in the schemas. If left unspecified, + the package will be derived from the schemas only. --> + <generatePackage>${project.xsd.schemas.package.name}</generatePackage> + + <!-- I don't think I need the next two options because mvn clean should + make the trick, anyhow, I am using them. If true, the generateDirectory will + be deleted before the XJC binding compiler recompiles the source files. Default + is false. --> + <removeOldOutput>true</removeOldOutput> + <!-- If true (default), package directories will be cleaned before the + XJC binding compiler generates the source files. --> + <cleanPackageDirectories>true</cleanPackageDirectories> + + <!-- Encoding for the generated sources, defaults to ${project.build.sourceEncoding}. --> + <encoding>${project.build.sourceEncoding}</encoding> + + <!-- Locale used during generation, for instance en, de, fr etc. This + will, for instance, influence the language of the generated JavaDoc comments. --> + <locale>en</locale> + + <!-- This nice configuration avoids to use build-helper-maven-plugin --> + <addCompileSourceRoot>true</addCompileSourceRoot> + <addTestCompileSourceRoot>false</addTestCompileSourceRoot> + + <!-- If true (default), XJC will perform strict validation of the input + schema. If strict is set to false XJC will be run with -nv, this disables + strict validation of schemas. + + The plugin is configured to use catalogs and strict mode at the + same time. Using catalogs to resolve schema URIs in strict mode is known + to be problematic and may fail. Please refer to the following link for more + information: https://github.com/highsource/maven-jaxb2-plugin/wiki/Catalogs-in-Strict-Mode + Consider setting <strict>false</strict> in your plugin configuration. --> + <strict>false</strict> + + <verbose>true</verbose> + + <extension>true</extension> + <args> + <arg>-Xinheritance</arg> + <arg>-Xannotate</arg> + </args> + <plugins> + <plugin> + <groupId>org.jvnet.jaxb2_commons</groupId> + <artifactId>jaxb2-basics</artifactId> + <version>0.9.5</version> + </plugin> + <plugin> + <groupId>org.jvnet.jaxb2_commons</groupId> + <artifactId>jaxb2-basics-annotate</artifactId> + <version>1.0.2</version> + </plugin> + </plugins> + + + <!-- + GRAN DIFERENCIA: + + CON ESTE PLUGIN A DIFERENCIA DE cxf-xjc-plugin NO SE VUELVEN A GENERAR LOS OBJETOS DE parent.xsd + QUE SE ENCONTRABAN EN web-services-spring-jaxb2-globalxsds + + CON cxf-xjc-plugin SÃ SE VUELVEN A GENERAR INCLUSO AUNQUE USEMOS EPISODIOS :( + + CON ESTE PLUGIN CONSEGUIMOS NO EMPAQUETAR AQUÃ TAMBIÃN LAS MISMAS CLASES QUE + TENÃAMOS EN web-services-spring-jaxb2-globalxsds + --> + + <!-- You can use the useDependenciesAsEpisodes instead of configuring + individual episodes. In this case all the dependencies will be treated as + episodes which is very convenient (less configuration). I am going to use + the long way (individual episodes) --> + <useDependenciesAsEpisodes>false</useDependenciesAsEpisodes> + <catalog>src/main/build-resources/catalogs/catalog.cat</catalog> + <episodes> + <episode> + <groupId>de.spring.webservices</groupId> + <artifactId>web-services-spring-jaxb2-globalxsds</artifactId> + </episode> + </episodes> + </configuration> + </plugin> + </plugins> + </build> +</project> 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 @@ -<?xml version="1.0" encoding="UTF-8" ?> -<jaxws:bindings - xmlns:xs="http://www.w3.org/2001/XMLSchema" - xmlns:wsdl="http://schemas.xmlsoap.org/wsdl/" - xmlns:jaxws="http://java.sun.com/xml/ns/jaxws" - xmlns:jaxb="http://java.sun.com/xml/ns/jaxb" - xmlns:xjc="http://java.sun.com/xml/ns/jaxb/xjc" - xmlns:inheritance="http://jaxb2-commons.dev.java.net/basic/inheritance" - xmlns:annox="http://annox.dev.java.net" - jaxb:version="2.1" - jaxb:extensionBindingPrefixes="xjc inheritance annox"> - - <jaxws:bindings - node="wsdl:definitions"> - <jaxws:package name="de.spring.webservices.auto"/> - </jaxws:bindings> - - - <!-- - XSD namespace for included schema in WSDL: http://gumartinm.name/spring-ws/example - - I am skiping the XSD namespace for imported schema in WSDL: http://gumartinm.name/spring-ws/parent because I guess, - there must be some way of using the already generated code in web-services-spring-globalxsds instead of generating new one - (perhaps using maven-jaxb2-plugin with episodes) - --> - <jaxws:bindings - node="wsdl:definitions/wsdl:types/xs:schema[@targetNamespace='http://gumartinm.name/spring-ws/example']"> - - <jaxb:schemaBindings> - <jaxb:package name="de.spring.webservices.auto"/> - </jaxb:schemaBindings> - - <jaxb:bindings node="//xs:element[@name='CustomBindingExampleRequest']/xs:complextype"> - <inheritance:implements>de.spring.webservices.operations.Request</inheritance:implements> - <annox:annotate>@java.lang.suppresswarnings({"unchecked","rawtypes"})</annox:annotate> - </jaxb:bindings> - - <jaxb:bindings node="//xs:element[@name='CustomBindingExampleResponse']/xs:complextype"> - <inheritance:implements>de.spring.webservices.operations.Response</inheritance:implements> - <annox:annotate>@java.lang.suppresswarnings({"unchecked","rawtypes"})</annox:annotate> - </jaxb:bindings> - - <jaxb:globalBindings> - <xjc:javaType adapter="de.spring.webservices.binders.XSDateTimeCustomBinder" - name="java.util.Date" xmlType="xs:dateTime" /> - </jaxb:globalBindings> - - </jaxws:bindings> - -</jaxws:bindings> 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 @@ -<?xml version="1.0" encoding="UTF-8"?> -<catalog xmlns="urn:oasis:names:tc:entity:xmlns:xml:catalog" prefer="system|public" > - <!-- - An XML catalog will allow us to specify real locations for our imported XML schemas. - The XJC tool supports several different XML Catalog formats: TR9401, XCatalog, OASIS XML Catalog. - I am using OASIS XML Catalog Format - - OASIS XML Catalog Format: https://www.oasis-open.org/committees/entity/specs/cs-entity-xml-catalogs-1.0.html - TR9401: https://www.oasis-open.org/specs/a401.htm +REWRITE_SYSTEM "http://gumartinm.name/spring-ws/parent/parent.xsd" "maven:de.spring.webservices:web-services-spring-jaxb2-globalxsds:jar::!/schemas/parent.xsd" + +-- + This configuration is better (it relies on namespace instead of schemaLocation) but it doesn't work + because of this bug: https://java.net/jira/browse/JAXB-942 + + PUBLIC "xmlns:parent" "maven:de.spring.webservices:web-services-spring-jaxb2-globalxsds:jar::!/schemas/parent.xsd" + +-- - See: http://labs.bsb.com/2011/01/usage-of-an-xml-catalog-in-the-xmlbeans-cxf-integration/ - http://cxf.apache.org/cxf-xjc-plugin.html - https://jaxb.java.net/2.2.4/docs/catalog.html - --> - - - <!-- I JUST NEED THIS CONFIGURATION, ANYHOW I AM WRITING ALL OF THEM --> - <rewriteSystem systemIdStartString="http://gumartinm.name/spring-ws/parent" - rewritePrefix="classpath:parent.xsd"/> - - - <!-- THE FOLLOWING ONES ARE NOT REQUIRED EVEN IF I AM WRITING THEM --> - <public - publicId="http://gumartinm.name/spring-ws/parent" - uri="classpath:parent.xsd"/> - - - <system - systemId="http://gumartinm.name/spring-ws/parent/parent.xsd" - uri="classpath:parent.xsd"/> - - - <rewriteURI uriStartString="http://gumartinm.name/spring-ws/parent" - rewritePrefix="classpath:parent.xsd"/> - -</catalog> 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 @@ <!-- GRAN DIFERENCIA: - CON ESTE PLUGIN A DIFERENCIA DE cxf-xjc-plugin NO SE VUELVEN A GENERAR LOS OBJETOS DE parent.xsd + :) CON ESTE PLUGIN A DIFERENCIA DE cxf-xjc-plugin NO SE VUELVEN A GENERAR LOS OBJETOS DE parent.xsd QUE SE ENCONTRABAN EN web-services-spring-jaxb2-globalxsds CON cxf-xjc-plugin SÃ SE VUELVEN A GENERAR INCLUSO AUNQUE USEMOS EPISODIOS :( 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 5f2293f..a59c214 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 @@ -50,7 +50,7 @@ <!-- Spring makes the WSDL file for us from the XSD file. Launch the Jetty server and download WSDL file from this URL: - http://localhost:8080/web-services-spring-server/spring-ws/example/example.wsdl + http://localhost:8080/web-services-spring-jaxb2-server/spring-ws/example/example.wsdl --> <sws:dynamic-wsdl id="example" portTypeName="Examples" createSoap12Binding="true" createSoap11Binding="false" -- 2.1.4