From 8798453cc9d0aa2ca2ddd5d8cc01467ffc974ddd Mon Sep 17 00:00:00 2001 From: Gustavo Martin Morcuende Date: Fri, 15 Jul 2016 20:54:36 +0200 Subject: [PATCH] I do not know why but JAXB2 works better when XSD types end with the Type suffix --- .../src/main/build-resources/wsdl/example.wsdl | 4 ++-- .../src/main/resources/examples.xsd | 2 +- .../src/main/resources/parent.xsd | 11 +++++++---- .../endpoints/MyCustomMappingExceptionResolver.java | 12 ++++++------ .../src/main/resources/examples.xsd | 2 +- .../src/main/build-resources/wsdl/example.wsdl | 2 +- .../src/main/resources/schemas/examples.xsd | 2 +- .../src/main/resources/schemas/parent.xsd | 11 +++++++---- .../endpoints/MyCustomMappingExceptionResolver.java | 10 +++++----- .../src/main/resources/schemas/examples.xsd | 2 +- 10 files changed, 32 insertions(+), 26 deletions(-) diff --git a/SOAP/cxf/web-services-spring-cxf-client/src/main/build-resources/wsdl/example.wsdl b/SOAP/cxf/web-services-spring-cxf-client/src/main/build-resources/wsdl/example.wsdl index e3f61ed..ff364f5 100644 --- a/SOAP/cxf/web-services-spring-cxf-client/src/main/build-resources/wsdl/example.wsdl +++ b/SOAP/cxf/web-services-spring-cxf-client/src/main/build-resources/wsdl/example.wsdl @@ -38,7 +38,7 @@ - + @@ -191,4 +191,4 @@ - \ No newline at end of file + diff --git a/SOAP/cxf/web-services-spring-cxf-client/src/main/resources/examples.xsd b/SOAP/cxf/web-services-spring-cxf-client/src/main/resources/examples.xsd index 59cd317..73d9a8c 100644 --- a/SOAP/cxf/web-services-spring-cxf-client/src/main/resources/examples.xsd +++ b/SOAP/cxf/web-services-spring-cxf-client/src/main/resources/examples.xsd @@ -47,7 +47,7 @@ - + diff --git a/SOAP/cxf/web-services-spring-cxf-globalxsds/src/main/resources/parent.xsd b/SOAP/cxf/web-services-spring-cxf-globalxsds/src/main/resources/parent.xsd index b38ca36..f33c496 100644 --- a/SOAP/cxf/web-services-spring-cxf-globalxsds/src/main/resources/parent.xsd +++ b/SOAP/cxf/web-services-spring-cxf-globalxsds/src/main/resources/parent.xsd @@ -14,6 +14,7 @@ specifies child elements can only appear in the order mentioned. --> + @@ -24,24 +25,26 @@ - + + - + + - + - + diff --git a/SOAP/cxf/web-services-spring-cxf-server/src/main/java/de/spring/webservices/endpoints/MyCustomMappingExceptionResolver.java b/SOAP/cxf/web-services-spring-cxf-server/src/main/java/de/spring/webservices/endpoints/MyCustomMappingExceptionResolver.java index 9d05061..01d80ab 100644 --- a/SOAP/cxf/web-services-spring-cxf-server/src/main/java/de/spring/webservices/endpoints/MyCustomMappingExceptionResolver.java +++ b/SOAP/cxf/web-services-spring-cxf-server/src/main/java/de/spring/webservices/endpoints/MyCustomMappingExceptionResolver.java @@ -20,8 +20,8 @@ import org.springframework.ws.soap.server.endpoint.SoapFaultDefinition; import org.springframework.ws.soap.server.endpoint.SoapFaultDefinitionEditor; import de.spring.webservices.exceptions.CustomBusinessException; -import de.spring.webservices.server.auto.Element; -import de.spring.webservices.server.auto.GeneralFault; +import de.spring.webservices.parent.auto.ElementType; +import de.spring.webservices.parent.auto.GeneralFault; public class MyCustomMappingExceptionResolver extends AbstractSoapFaultDefinitionExceptionResolver { private static final Logger LOGGER = LoggerFactory.getLogger(MyCustomMappingExceptionResolver.class); @@ -97,8 +97,8 @@ public class MyCustomMappingExceptionResolver extends AbstractSoapFaultDefinitio GeneralFault customFault = new GeneralFault(); customFault.setTechnicalError(getStackTrace(ex)); - Element element = buildElement(ex); - List elements = customFault.getElements(); + ElementType element = buildElement(ex); + List elements = customFault.getElements(); elements.add(element); SoapFaultDetail detail = fault.addFaultDetail(); @@ -114,8 +114,8 @@ public class MyCustomMappingExceptionResolver extends AbstractSoapFaultDefinitio this.marshaller = marshaller; } - private Element buildElement(Exception ex) { - Element element = new Element(); + private ElementType buildElement(Exception ex) { + ElementType element = new ElementType(); element.setMessage(ex.getMessage()); if (ex instanceof CustomBusinessException) { diff --git a/SOAP/cxf/web-services-spring-cxf-server/src/main/resources/examples.xsd b/SOAP/cxf/web-services-spring-cxf-server/src/main/resources/examples.xsd index 59cd317..73d9a8c 100644 --- a/SOAP/cxf/web-services-spring-cxf-server/src/main/resources/examples.xsd +++ b/SOAP/cxf/web-services-spring-cxf-server/src/main/resources/examples.xsd @@ -47,7 +47,7 @@ - + diff --git a/SOAP/jaxb2/web-services-spring-jaxb2-client/src/main/build-resources/wsdl/example.wsdl b/SOAP/jaxb2/web-services-spring-jaxb2-client/src/main/build-resources/wsdl/example.wsdl index 202d87b..140de62 100644 --- a/SOAP/jaxb2/web-services-spring-jaxb2-client/src/main/build-resources/wsdl/example.wsdl +++ b/SOAP/jaxb2/web-services-spring-jaxb2-client/src/main/build-resources/wsdl/example.wsdl @@ -38,7 +38,7 @@ - + diff --git a/SOAP/jaxb2/web-services-spring-jaxb2-client/src/main/resources/schemas/examples.xsd b/SOAP/jaxb2/web-services-spring-jaxb2-client/src/main/resources/schemas/examples.xsd index 59cd317..73d9a8c 100644 --- a/SOAP/jaxb2/web-services-spring-jaxb2-client/src/main/resources/schemas/examples.xsd +++ b/SOAP/jaxb2/web-services-spring-jaxb2-client/src/main/resources/schemas/examples.xsd @@ -47,7 +47,7 @@ - + diff --git a/SOAP/jaxb2/web-services-spring-jaxb2-globalxsds/src/main/resources/schemas/parent.xsd b/SOAP/jaxb2/web-services-spring-jaxb2-globalxsds/src/main/resources/schemas/parent.xsd index b38ca36..f33c496 100644 --- a/SOAP/jaxb2/web-services-spring-jaxb2-globalxsds/src/main/resources/schemas/parent.xsd +++ b/SOAP/jaxb2/web-services-spring-jaxb2-globalxsds/src/main/resources/schemas/parent.xsd @@ -14,6 +14,7 @@ specifies child elements can only appear in the order mentioned. --> + @@ -24,24 +25,26 @@ - + + - + + - + - + diff --git a/SOAP/jaxb2/web-services-spring-jaxb2-server/src/main/java/de/spring/webservices/endpoints/MyCustomMappingExceptionResolver.java b/SOAP/jaxb2/web-services-spring-jaxb2-server/src/main/java/de/spring/webservices/endpoints/MyCustomMappingExceptionResolver.java index 382cd74..01d80ab 100644 --- a/SOAP/jaxb2/web-services-spring-jaxb2-server/src/main/java/de/spring/webservices/endpoints/MyCustomMappingExceptionResolver.java +++ b/SOAP/jaxb2/web-services-spring-jaxb2-server/src/main/java/de/spring/webservices/endpoints/MyCustomMappingExceptionResolver.java @@ -20,7 +20,7 @@ import org.springframework.ws.soap.server.endpoint.SoapFaultDefinition; import org.springframework.ws.soap.server.endpoint.SoapFaultDefinitionEditor; import de.spring.webservices.exceptions.CustomBusinessException; -import de.spring.webservices.parent.auto.Element; +import de.spring.webservices.parent.auto.ElementType; import de.spring.webservices.parent.auto.GeneralFault; public class MyCustomMappingExceptionResolver extends AbstractSoapFaultDefinitionExceptionResolver { @@ -97,8 +97,8 @@ public class MyCustomMappingExceptionResolver extends AbstractSoapFaultDefinitio GeneralFault customFault = new GeneralFault(); customFault.setTechnicalError(getStackTrace(ex)); - Element element = buildElement(ex); - List elements = customFault.getElements(); + ElementType element = buildElement(ex); + List elements = customFault.getElements(); elements.add(element); SoapFaultDetail detail = fault.addFaultDetail(); @@ -114,8 +114,8 @@ public class MyCustomMappingExceptionResolver extends AbstractSoapFaultDefinitio this.marshaller = marshaller; } - private Element buildElement(Exception ex) { - Element element = new Element(); + private ElementType buildElement(Exception ex) { + ElementType element = new ElementType(); element.setMessage(ex.getMessage()); if (ex instanceof CustomBusinessException) { diff --git a/SOAP/jaxb2/web-services-spring-jaxb2-server/src/main/resources/schemas/examples.xsd b/SOAP/jaxb2/web-services-spring-jaxb2-server/src/main/resources/schemas/examples.xsd index 59cd317..73d9a8c 100644 --- a/SOAP/jaxb2/web-services-spring-jaxb2-server/src/main/resources/schemas/examples.xsd +++ b/SOAP/jaxb2/web-services-spring-jaxb2-server/src/main/resources/schemas/examples.xsd @@ -47,7 +47,7 @@ - + -- 2.1.4