From 3449221b8fa0b95a792abde0d2b9f6309d81bd95 Mon Sep 17 00:00:00 2001 From: Gustavo Martin Morcuende Date: Mon, 8 Jun 2015 01:20:42 +0200 Subject: [PATCH] client integration tests, client custom bindings --- README.md | 2 - web-services-spring-client/pom.xml | 18 ++- .../build-resources/bindings/custombinding.xjb | 50 +++++++++ .../src/main/build-resources/catalog.cat | 16 --- .../src/main/build-resources/catalogs/catalog.cat | 38 +++++++ .../src/main/build-resources/wsdl/example.wsdl | 122 +++++++++++++++++++++ .../webservices/client/ExampleClientService.java | 17 +-- .../de/spring/webservices/client/MainTest.java | 31 +++++- .../spring/webservices/operations/Operations.java | 111 ------------------- .../de/spring/webservices/operations/Request.java | 5 - .../de/spring/webservices/operations/Response.java | 5 - .../src/main/resources/bindings/custombinding.xjb | 44 -------- .../src/main/resources/examples.xsd | 70 ++++++++++++ .../src/main/resources/log4j2.xml | 14 +++ .../client-spring-configuration.xml | 80 -------------- .../ws/client-spring-configuration.xml | 96 ++++++++++++++++ .../src/main/resources/wsdl/example.wsdl | 113 ------------------- .../src/main/resources/xsd/examples.xsd | 60 ---------- .../ExampleClientServiceIntegrationTest.java | 31 +++++- .../binders/XSDateTimeCustomBinder.java | 35 ++++++ .../spring/webservices/operations/Operations.java | 111 +++++++++++++++++++ .../de/spring/webservices/operations/Request.java | 5 + .../de/spring/webservices/operations/Response.java | 5 + .../binders/XSDateTimeCustomBinder.java | 30 ----- .../spring/webservices/operations/Operations.java | 111 ------------------- .../de/spring/webservices/operations/Request.java | 5 - .../de/spring/webservices/operations/Response.java | 5 - .../src/main/resources/examples.xsd | 8 +- .../resources/spring-configuration/ws/soap-ws.xml | 2 +- 29 files changed, 628 insertions(+), 612 deletions(-) create mode 100644 web-services-spring-client/src/main/build-resources/bindings/custombinding.xjb delete mode 100644 web-services-spring-client/src/main/build-resources/catalog.cat create mode 100644 web-services-spring-client/src/main/build-resources/catalogs/catalog.cat create mode 100644 web-services-spring-client/src/main/build-resources/wsdl/example.wsdl delete mode 100644 web-services-spring-client/src/main/java/de/spring/webservices/operations/Operations.java delete mode 100644 web-services-spring-client/src/main/java/de/spring/webservices/operations/Request.java delete mode 100644 web-services-spring-client/src/main/java/de/spring/webservices/operations/Response.java delete mode 100644 web-services-spring-client/src/main/resources/bindings/custombinding.xjb create mode 100644 web-services-spring-client/src/main/resources/examples.xsd create mode 100644 web-services-spring-client/src/main/resources/log4j2.xml delete mode 100644 web-services-spring-client/src/main/resources/spring-configuration/client-spring-configuration.xml create mode 100644 web-services-spring-client/src/main/resources/spring-configuration/ws/client-spring-configuration.xml delete mode 100644 web-services-spring-client/src/main/resources/wsdl/example.wsdl delete mode 100644 web-services-spring-client/src/main/resources/xsd/examples.xsd create mode 100644 web-services-spring-globalxsds/src/main/java/de/spring/webservices/binders/XSDateTimeCustomBinder.java create mode 100644 web-services-spring-globalxsds/src/main/java/de/spring/webservices/operations/Operations.java create mode 100644 web-services-spring-globalxsds/src/main/java/de/spring/webservices/operations/Request.java create mode 100644 web-services-spring-globalxsds/src/main/java/de/spring/webservices/operations/Response.java delete mode 100644 web-services-spring-server/src/main/java/de/spring/webservices/binders/XSDateTimeCustomBinder.java delete mode 100644 web-services-spring-server/src/main/java/de/spring/webservices/operations/Operations.java delete mode 100644 web-services-spring-server/src/main/java/de/spring/webservices/operations/Request.java delete mode 100644 web-services-spring-server/src/main/java/de/spring/webservices/operations/Response.java diff --git a/README.md b/README.md index 9fe3e8b..bdea049 100644 --- a/README.md +++ b/README.md @@ -12,9 +12,7 @@ mvn clean install -Dmaven.test.skip=true TODO: maven-jaxb2-plugin in order to reuse generated Java code from other projects (cxf-xjc-plugin doesn't implement such feature without generating episodes by myself) -TODO: custom bindings when creating Java code from wsdl. TODO: using Jetty instead of Tomcat TODO: logging Spring information -TODO: integration tests (client and server) For debugging: export MAVEN_OPTS="-Xdebug -Xrunjdwp:transport=dt_socket,address=8000,server=y,suspend=y" diff --git a/web-services-spring-client/pom.xml b/web-services-spring-client/pom.xml index 4ba6e18..29e7648 100644 --- a/web-services-spring-client/pom.xml +++ b/web-services-spring-client/pom.xml @@ -12,9 +12,11 @@ http://gumartinm.name - src/main/resources/wsdl + src/main/build-resources/wsdl ${basedir}/target/generated-sources/src/main/java - src/main/resources/bindings + src/main/build-resources/bindings + + ${basedir}/src/main/build-resources/catalogs @@ -31,6 +33,15 @@ jdom + + + + de.spring.webservices + web-services-spring-globalxsds + ${project.version} + + + wsdl4j @@ -94,6 +105,7 @@ wsdl2java + true ${project.wsdl.target.path} @@ -107,6 +119,8 @@ -xjc-Xinheritance -xjc-Xannotate + -catalog + ${project.catalogs.path}/catalog.cat -verbose diff --git a/web-services-spring-client/src/main/build-resources/bindings/custombinding.xjb b/web-services-spring-client/src/main/build-resources/bindings/custombinding.xjb new file mode 100644 index 0000000..95e1fd2 --- /dev/null +++ b/web-services-spring-client/src/main/build-resources/bindings/custombinding.xjb @@ -0,0 +1,50 @@ + + + + + + + + + + + + + + + + + de.spring.webservices.operations.Request + @java.lang.suppresswarnings({"unchecked","rawtypes"}) + + + + de.spring.webservices.operations.Response + @java.lang.suppresswarnings({"unchecked","rawtypes"}) + + + + + + + + + diff --git a/web-services-spring-client/src/main/build-resources/catalog.cat b/web-services-spring-client/src/main/build-resources/catalog.cat deleted file mode 100644 index 82fe4bb..0000000 --- a/web-services-spring-client/src/main/build-resources/catalog.cat +++ /dev/null @@ -1,16 +0,0 @@ - - - - - - - - - - - - diff --git a/web-services-spring-client/src/main/build-resources/catalogs/catalog.cat b/web-services-spring-client/src/main/build-resources/catalogs/catalog.cat new file mode 100644 index 0000000..4bc1c66 --- /dev/null +++ b/web-services-spring-client/src/main/build-resources/catalogs/catalog.cat @@ -0,0 +1,38 @@ + + + + + + + + + + + + + + + + + + + + diff --git a/web-services-spring-client/src/main/build-resources/wsdl/example.wsdl b/web-services-spring-client/src/main/build-resources/wsdl/example.wsdl new file mode 100644 index 0000000..32d94de --- /dev/null +++ b/web-services-spring-client/src/main/build-resources/wsdl/example.wsdl @@ -0,0 +1,122 @@ + + + + + + + + + + + + + + + @java.lang.SuppressWarnings({"unchecked","rawtypes"}) + de.spring.webservices.operations.Request + + + + + + + + + + + + de.spring.webservices.operations.Response + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + diff --git a/web-services-spring-client/src/main/java/de/spring/webservices/client/ExampleClientService.java b/web-services-spring-client/src/main/java/de/spring/webservices/client/ExampleClientService.java index 71d357b..177c13e 100644 --- a/web-services-spring-client/src/main/java/de/spring/webservices/client/ExampleClientService.java +++ b/web-services-spring-client/src/main/java/de/spring/webservices/client/ExampleClientService.java @@ -1,21 +1,23 @@ package de.spring.webservices.client; -import name.gumartinm.spring_ws.example.CustomBindingExampleRequest; -import name.gumartinm.spring_ws.example.CustomBindingExampleResponse; -import name.gumartinm.spring_ws.example.ExampleRequest; -import name.gumartinm.spring_ws.example.ExampleResponse; -import name.gumartinm.spring_ws.example.Examples; -import name.gumartinm.spring_ws.example.ExamplesService; +import name.gumartinm.spring_ws.parent.ParentEnumType; import org.springframework.beans.factory.annotation.Autowired; 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; + /** * Someone could write code like this one in order to send and receive * information from our Web Services. * */ -public class ExampleClientService { +public class ExampleClientService { private final WebServiceTemplate webServiceTemplate; @Autowired @@ -47,6 +49,7 @@ public class ExampleClientService { 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 = diff --git a/web-services-spring-client/src/main/java/de/spring/webservices/client/MainTest.java b/web-services-spring-client/src/main/java/de/spring/webservices/client/MainTest.java index fc808e3..48fbdcd 100644 --- a/web-services-spring-client/src/main/java/de/spring/webservices/client/MainTest.java +++ b/web-services-spring-client/src/main/java/de/spring/webservices/client/MainTest.java @@ -1,14 +1,21 @@ package de.spring.webservices.client; +import org.slf4j.Logger; +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; + /** * This class is used just like a nice example about how to write and run client * code which will send data to and from the Web Services. * */ public class MainTest { + private static final Logger logger = LoggerFactory.getLogger(MainTest.class); + public ApplicationContext context; /** @@ -18,14 +25,28 @@ public class MainTest { final MainTest test = new MainTest(); test.context = new ClassPathXmlApplicationContext( - "client-spring-configuration.xml"); + "classpath:spring-configuration/ws/client-spring-configuration.xml"); final ExampleClientService example = (ExampleClientService) test.context.getBean("exampleClient"); - example.sendAndReceiveJava(); - example.sendAndReceiveJavaCustom(); - example.sendAndReceiveSpring(); - example.sendAndReceiveSpringCustom(); + 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("ExampleResponse Spring:"); + response = example.sendAndReceiveSpring(); + logger.info(response.getData()); + + + logger.info("CustomBindingExampleResponse Spring:"); + customBindingResponse = example.sendAndReceiveSpringCustom(); + logger.info(customBindingResponse.getData()); } } diff --git a/web-services-spring-client/src/main/java/de/spring/webservices/operations/Operations.java b/web-services-spring-client/src/main/java/de/spring/webservices/operations/Operations.java deleted file mode 100644 index 13b5113..0000000 --- a/web-services-spring-client/src/main/java/de/spring/webservices/operations/Operations.java +++ /dev/null @@ -1,111 +0,0 @@ -package de.spring.webservices.operations; - -/** - *

- * Operations: WSDL v1.1 and v2.0 - *

- * See: http://www.w3.org/TR/wsdl#_porttypes
- * See: - * http://www.w3.org/TR/2007/REC-wsdl20-adjuncts-20070626/#patterns - * - */ -public interface Operations { - - /** - *

- * Request-response operation WSDL v1.1 - *

- * See: http://www.w3.org - * /TR/wsdl#_request-response - * - * @param - * Describes {@link Response} - * @param - * Describes {@link Request} - */ - public static interface RequestResponse { - T requestResponse(E request); - } - - /** - *

- * One-way operation WSDL v1.1 - *

- * See: http://www.w3.org/TR/wsdl - * #_one-way - * - * @param - * Describes {@link Response} - * @param - * Describes {@link Request} - */ - public interface OneWay { - void oneWay(E request); - } - - /** - *

- * Notification operation WSDL v1.1 - *

- * See: http://www.w3.org/TR - * /wsdl#_notification - * - * @param - * Describes {@link Response} - * @param - * Describes {@link Request} - */ - public interface Notification { - T notification(); - } - - /** - *

- * In-Only message exchange pattern WSDL 2.0 - *

- * See: - * http://www.w3.org/TR/2007/REC-wsdl20-adjuncts-20070626/#patterns - * - * @param - * Describes {@link Request} - */ - public interface InOnly { - void inOnly(E request); - } - - /** - *

- * Robust In-Only message exchange pattern WSDL 2.0 - *

- * See: - * http://www.w3.org/TR/2007/REC-wsdl20-adjuncts-20070626/#patterns - * - * @param - * Describes {@link Request} - */ - public interface RobustInOnly { - void robustInOnly(E request); - } - - /** - *

- * In-Out message exchange pattern WSDL 2.0 - *

- * See: - * http://www.w3.org/TR/2007/REC-wsdl20-adjuncts-20070626/#patterns - * - * @param - * Describes {@link Response} - * @param - * Describes {@link Request} - */ - public interface InOut { - T inOut(E request); - } -} \ No newline at end of file diff --git a/web-services-spring-client/src/main/java/de/spring/webservices/operations/Request.java b/web-services-spring-client/src/main/java/de/spring/webservices/operations/Request.java deleted file mode 100644 index 77d81f4..0000000 --- a/web-services-spring-client/src/main/java/de/spring/webservices/operations/Request.java +++ /dev/null @@ -1,5 +0,0 @@ -package de.spring.webservices.operations; - -public interface Request { - -} diff --git a/web-services-spring-client/src/main/java/de/spring/webservices/operations/Response.java b/web-services-spring-client/src/main/java/de/spring/webservices/operations/Response.java deleted file mode 100644 index 3a2cbea..0000000 --- a/web-services-spring-client/src/main/java/de/spring/webservices/operations/Response.java +++ /dev/null @@ -1,5 +0,0 @@ -package de.spring.webservices.operations; - -public interface Response { - -} diff --git a/web-services-spring-client/src/main/resources/bindings/custombinding.xjb b/web-services-spring-client/src/main/resources/bindings/custombinding.xjb deleted file mode 100644 index 4663aad..0000000 --- a/web-services-spring-client/src/main/resources/bindings/custombinding.xjb +++ /dev/null @@ -1,44 +0,0 @@ - - - - - - - - - - - diff --git a/web-services-spring-client/src/main/resources/examples.xsd b/web-services-spring-client/src/main/resources/examples.xsd new file mode 100644 index 0000000..ae7a793 --- /dev/null +++ b/web-services-spring-client/src/main/resources/examples.xsd @@ -0,0 +1,70 @@ + + + + + + + + + + + + + @java.lang.SuppressWarnings({"unchecked","rawtypes"}) + de.spring.webservices.operations.Request + + + + + + + + + + + + de.spring.webservices.operations.Response + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + diff --git a/web-services-spring-client/src/main/resources/log4j2.xml b/web-services-spring-client/src/main/resources/log4j2.xml new file mode 100644 index 0000000..18a4008 --- /dev/null +++ b/web-services-spring-client/src/main/resources/log4j2.xml @@ -0,0 +1,14 @@ + + + + + + + + + + + + + diff --git a/web-services-spring-client/src/main/resources/spring-configuration/client-spring-configuration.xml b/web-services-spring-client/src/main/resources/spring-configuration/client-spring-configuration.xml deleted file mode 100644 index 32da905..0000000 --- a/web-services-spring-client/src/main/resources/spring-configuration/client-spring-configuration.xml +++ /dev/null @@ -1,80 +0,0 @@ - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - diff --git a/web-services-spring-client/src/main/resources/spring-configuration/ws/client-spring-configuration.xml b/web-services-spring-client/src/main/resources/spring-configuration/ws/client-spring-configuration.xml new file mode 100644 index 0000000..785d2db --- /dev/null +++ b/web-services-spring-client/src/main/resources/spring-configuration/ws/client-spring-configuration.xml @@ -0,0 +1,96 @@ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + classpath:examples.xsd + classpath:parent.xsd + + + + + + + + + + + + + + + + + + + + + + + + + + + diff --git a/web-services-spring-client/src/main/resources/wsdl/example.wsdl b/web-services-spring-client/src/main/resources/wsdl/example.wsdl deleted file mode 100644 index 895be2b..0000000 --- a/web-services-spring-client/src/main/resources/wsdl/example.wsdl +++ /dev/null @@ -1,113 +0,0 @@ - - - - - - - - - - - - @java.lang.SuppressWarnings({"unchecked","rawtypes"}) - de.spring.webservices.operations.Request - - - - - - - - - - - - de.spring.webservices.operations.Response - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - \ No newline at end of file diff --git a/web-services-spring-client/src/main/resources/xsd/examples.xsd b/web-services-spring-client/src/main/resources/xsd/examples.xsd deleted file mode 100644 index 7f431c6..0000000 --- a/web-services-spring-client/src/main/resources/xsd/examples.xsd +++ /dev/null @@ -1,60 +0,0 @@ - - - - - - - - - - @java.lang.SuppressWarnings({"unchecked","rawtypes"}) - de.spring.webservices.operations.Request - - - - - - - - - - - - de.spring.webservices.operations.Response - - - - - - - - - - - - - - - - - - - - - - - - - - - diff --git a/web-services-spring-client/src/test/java/de/spring/webservices/client/ExampleClientServiceIntegrationTest.java b/web-services-spring-client/src/test/java/de/spring/webservices/client/ExampleClientServiceIntegrationTest.java index d4ebf5a..a536c47 100644 --- a/web-services-spring-client/src/test/java/de/spring/webservices/client/ExampleClientServiceIntegrationTest.java +++ b/web-services-spring-client/src/test/java/de/spring/webservices/client/ExampleClientServiceIntegrationTest.java @@ -1,13 +1,11 @@ package de.spring.webservices.client; +import static org.junit.Assert.assertEquals; import static org.springframework.ws.test.client.RequestMatchers.payload; import static org.springframework.ws.test.client.ResponseCreators.withPayload; -import static org.junit.Assert.*; import javax.xml.transform.Source; -import name.gumartinm.spring_ws.example.ExampleResponse; - import org.junit.Before; import org.junit.Test; import org.junit.runner.RunWith; @@ -18,9 +16,12 @@ 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; + @RunWith(SpringJUnit4ClassRunner.class) -@ContextConfiguration("/client-spring-configuration.xml") +@ContextConfiguration("classpath*:spring-configuration/ws/client-spring-configuration.xml") public class ExampleClientServiceIntegrationTest { @Autowired @@ -49,10 +50,28 @@ public class ExampleClientServiceIntegrationTest { mockServer.expect(payload(requestPayload)).andRespond( withPayload(responsePayload)); - final ExampleResponse exampleResponse = exampleClientService.sendAndReceiveSpring(); + final ExampleResponse response = exampleClientService.sendAndReceiveSpring(); - assertEquals(exampleResponse.getData(), "SNAKE EYES AND SCARLETT SPRING. IT IS CANON."); + assertEquals(response.getData(), "SNAKE EYES AND SCARLETT SPRING. IT IS CANON."); + mockServer.verify(); + } + + @Test + public void customerCustomClient() throws Exception { + final Source customRequestPayload = new StringSource( + "" + + "CUSTOM BINDING SPRING. SCARLETT. IT IS CANON." + + ""); + final Source customResponsePayload = new StringSource( + "" + + "CUSTOM BINDING SNAKE EYES AND SCARLETT SPRING. IT IS CANON." + + ""); + mockServer.expect(payload(customRequestPayload)).andRespond( + withPayload(customResponsePayload)); + final CustomBindingExampleResponse response = exampleClientService.sendAndReceiveSpringCustom(); + + assertEquals(response.getData(), "CUSTOM BINDING SNAKE EYES AND SCARLETT SPRING. IT IS CANON."); mockServer.verify(); } } diff --git a/web-services-spring-globalxsds/src/main/java/de/spring/webservices/binders/XSDateTimeCustomBinder.java b/web-services-spring-globalxsds/src/main/java/de/spring/webservices/binders/XSDateTimeCustomBinder.java new file mode 100644 index 0000000..f39921a --- /dev/null +++ b/web-services-spring-globalxsds/src/main/java/de/spring/webservices/binders/XSDateTimeCustomBinder.java @@ -0,0 +1,35 @@ +package de.spring.webservices.binders; + +import java.text.DateFormat; +import java.text.SimpleDateFormat; +import java.util.Date; +import java.util.TimeZone; + +import javax.xml.bind.annotation.adapters.XmlAdapter; + + +/** + * ATTENTION: if you are using this custombinder you will have to create custom payload + * validators for Spring (AS FAR AS I KNOW) + * + */ +public class XSDateTimeCustomBinder extends XmlAdapter { + + @Override + public Date unmarshal(final String dateTime) throws Exception { + // X pattern just works from Java >= 1.7 + final DateFormat formatter = new SimpleDateFormat("yyyy-MM-dd'T'HH:mm:ssX"); + formatter.setTimeZone(TimeZone.getTimeZone("Europe/Madrid")); + + return formatter.parse(dateTime); + } + + @Override + public String marshal(final Date dateTime) throws Exception { + // X pattern just works from Java >= 1.7 + final DateFormat formatter = new SimpleDateFormat("yyyy-MM-dd'T'HH:mm:ssX"); + formatter.setTimeZone(TimeZone.getTimeZone("Europe/Madrid")); + + return formatter.format(dateTime); + } +} diff --git a/web-services-spring-globalxsds/src/main/java/de/spring/webservices/operations/Operations.java b/web-services-spring-globalxsds/src/main/java/de/spring/webservices/operations/Operations.java new file mode 100644 index 0000000..13b5113 --- /dev/null +++ b/web-services-spring-globalxsds/src/main/java/de/spring/webservices/operations/Operations.java @@ -0,0 +1,111 @@ +package de.spring.webservices.operations; + +/** + *

+ * Operations: WSDL v1.1 and v2.0 + *

+ * See: http://www.w3.org/TR/wsdl#_porttypes
+ * See: + * http://www.w3.org/TR/2007/REC-wsdl20-adjuncts-20070626/#patterns + * + */ +public interface Operations { + + /** + *

+ * Request-response operation WSDL v1.1 + *

+ * See: http://www.w3.org + * /TR/wsdl#_request-response + * + * @param + * Describes {@link Response} + * @param + * Describes {@link Request} + */ + public static interface RequestResponse { + T requestResponse(E request); + } + + /** + *

+ * One-way operation WSDL v1.1 + *

+ * See: http://www.w3.org/TR/wsdl + * #_one-way + * + * @param + * Describes {@link Response} + * @param + * Describes {@link Request} + */ + public interface OneWay { + void oneWay(E request); + } + + /** + *

+ * Notification operation WSDL v1.1 + *

+ * See: http://www.w3.org/TR + * /wsdl#_notification + * + * @param + * Describes {@link Response} + * @param + * Describes {@link Request} + */ + public interface Notification { + T notification(); + } + + /** + *

+ * In-Only message exchange pattern WSDL 2.0 + *

+ * See: + * http://www.w3.org/TR/2007/REC-wsdl20-adjuncts-20070626/#patterns + * + * @param + * Describes {@link Request} + */ + public interface InOnly { + void inOnly(E request); + } + + /** + *

+ * Robust In-Only message exchange pattern WSDL 2.0 + *

+ * See: + * http://www.w3.org/TR/2007/REC-wsdl20-adjuncts-20070626/#patterns + * + * @param + * Describes {@link Request} + */ + public interface RobustInOnly { + void robustInOnly(E request); + } + + /** + *

+ * In-Out message exchange pattern WSDL 2.0 + *

+ * See: + * http://www.w3.org/TR/2007/REC-wsdl20-adjuncts-20070626/#patterns + * + * @param + * Describes {@link Response} + * @param + * Describes {@link Request} + */ + public interface InOut { + T inOut(E request); + } +} \ No newline at end of file diff --git a/web-services-spring-globalxsds/src/main/java/de/spring/webservices/operations/Request.java b/web-services-spring-globalxsds/src/main/java/de/spring/webservices/operations/Request.java new file mode 100644 index 0000000..77d81f4 --- /dev/null +++ b/web-services-spring-globalxsds/src/main/java/de/spring/webservices/operations/Request.java @@ -0,0 +1,5 @@ +package de.spring.webservices.operations; + +public interface Request { + +} diff --git a/web-services-spring-globalxsds/src/main/java/de/spring/webservices/operations/Response.java b/web-services-spring-globalxsds/src/main/java/de/spring/webservices/operations/Response.java new file mode 100644 index 0000000..3a2cbea --- /dev/null +++ b/web-services-spring-globalxsds/src/main/java/de/spring/webservices/operations/Response.java @@ -0,0 +1,5 @@ +package de.spring.webservices.operations; + +public interface Response { + +} diff --git a/web-services-spring-server/src/main/java/de/spring/webservices/binders/XSDateTimeCustomBinder.java b/web-services-spring-server/src/main/java/de/spring/webservices/binders/XSDateTimeCustomBinder.java deleted file mode 100644 index 46076f4..0000000 --- a/web-services-spring-server/src/main/java/de/spring/webservices/binders/XSDateTimeCustomBinder.java +++ /dev/null @@ -1,30 +0,0 @@ -package de.spring.webservices.binders; - -import java.text.DateFormat; -import java.text.SimpleDateFormat; -import java.util.Date; -import java.util.TimeZone; - -import javax.xml.bind.annotation.adapters.XmlAdapter; - - -public class XSDateTimeCustomBinder extends XmlAdapter { - - @Override - public Date unmarshal(final String dateTime) throws Exception { - // X pattern just works from Java >= 1.7 - final DateFormat formatter = new SimpleDateFormat("yyyy-MM-dd'T'HH:mm:ssX"); - formatter.setTimeZone(TimeZone.getTimeZone("Europe/Madrid")); - - return formatter.parse(dateTime); - } - - @Override - public String marshal(final Date dateTime) throws Exception { - // X pattern just works from Java >= 1.7 - final DateFormat formatter = new SimpleDateFormat("yyyy-MM-dd'T'HH:mm:ssX"); - formatter.setTimeZone(TimeZone.getTimeZone("Europe/Madrid")); - - return formatter.format(dateTime); - } -} diff --git a/web-services-spring-server/src/main/java/de/spring/webservices/operations/Operations.java b/web-services-spring-server/src/main/java/de/spring/webservices/operations/Operations.java deleted file mode 100644 index 13b5113..0000000 --- a/web-services-spring-server/src/main/java/de/spring/webservices/operations/Operations.java +++ /dev/null @@ -1,111 +0,0 @@ -package de.spring.webservices.operations; - -/** - *

- * Operations: WSDL v1.1 and v2.0 - *

- * See: http://www.w3.org/TR/wsdl#_porttypes
- * See: - * http://www.w3.org/TR/2007/REC-wsdl20-adjuncts-20070626/#patterns - * - */ -public interface Operations { - - /** - *

- * Request-response operation WSDL v1.1 - *

- * See: http://www.w3.org - * /TR/wsdl#_request-response - * - * @param - * Describes {@link Response} - * @param - * Describes {@link Request} - */ - public static interface RequestResponse { - T requestResponse(E request); - } - - /** - *

- * One-way operation WSDL v1.1 - *

- * See: http://www.w3.org/TR/wsdl - * #_one-way - * - * @param - * Describes {@link Response} - * @param - * Describes {@link Request} - */ - public interface OneWay { - void oneWay(E request); - } - - /** - *

- * Notification operation WSDL v1.1 - *

- * See: http://www.w3.org/TR - * /wsdl#_notification - * - * @param - * Describes {@link Response} - * @param - * Describes {@link Request} - */ - public interface Notification { - T notification(); - } - - /** - *

- * In-Only message exchange pattern WSDL 2.0 - *

- * See: - * http://www.w3.org/TR/2007/REC-wsdl20-adjuncts-20070626/#patterns - * - * @param - * Describes {@link Request} - */ - public interface InOnly { - void inOnly(E request); - } - - /** - *

- * Robust In-Only message exchange pattern WSDL 2.0 - *

- * See: - * http://www.w3.org/TR/2007/REC-wsdl20-adjuncts-20070626/#patterns - * - * @param - * Describes {@link Request} - */ - public interface RobustInOnly { - void robustInOnly(E request); - } - - /** - *

- * In-Out message exchange pattern WSDL 2.0 - *

- * See: - * http://www.w3.org/TR/2007/REC-wsdl20-adjuncts-20070626/#patterns - * - * @param - * Describes {@link Response} - * @param - * Describes {@link Request} - */ - public interface InOut { - T inOut(E request); - } -} \ No newline at end of file diff --git a/web-services-spring-server/src/main/java/de/spring/webservices/operations/Request.java b/web-services-spring-server/src/main/java/de/spring/webservices/operations/Request.java deleted file mode 100644 index 77d81f4..0000000 --- a/web-services-spring-server/src/main/java/de/spring/webservices/operations/Request.java +++ /dev/null @@ -1,5 +0,0 @@ -package de.spring.webservices.operations; - -public interface Request { - -} diff --git a/web-services-spring-server/src/main/java/de/spring/webservices/operations/Response.java b/web-services-spring-server/src/main/java/de/spring/webservices/operations/Response.java deleted file mode 100644 index 3a2cbea..0000000 --- a/web-services-spring-server/src/main/java/de/spring/webservices/operations/Response.java +++ /dev/null @@ -1,5 +0,0 @@ -package de.spring.webservices.operations; - -public interface Response { - -} diff --git a/web-services-spring-server/src/main/resources/examples.xsd b/web-services-spring-server/src/main/resources/examples.xsd index fa85466..ae7a793 100644 --- a/web-services-spring-server/src/main/resources/examples.xsd +++ b/web-services-spring-server/src/main/resources/examples.xsd @@ -51,8 +51,8 @@ - - + + @@ -60,8 +60,8 @@ - - + + diff --git a/web-services-spring-server/src/main/resources/spring-configuration/ws/soap-ws.xml b/web-services-spring-server/src/main/resources/spring-configuration/ws/soap-ws.xml index 378780d..afabf4e 100644 --- a/web-services-spring-server/src/main/resources/spring-configuration/ws/soap-ws.xml +++ b/web-services-spring-server/src/main/resources/spring-configuration/ws/soap-ws.xml @@ -40,7 +40,7 @@ + targetNamespace="http://gumartinm.name/resource/wsdl/schemas"> -- 2.1.4