<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>
jaxb:version="2.1"
jaxb:extensionBindingPrefixes="xjc inheritance annox">
+ <!--
+ Perhaps it would be better to relay on the package generated automatically from WSDL
+ In a real project, I guess, I should use the package generated from WSDL file...
+ -->
<jaxws:bindings
node="wsdl:definitions">
- <jaxws:package name="de.spring.webservices.auto"/>
+ <jaxws:package name="de.spring.webservices.client.auto"/>
</jaxws:bindings>
<jaxws:bindings
node="wsdl:definitions/wsdl:types/xs:schema[@targetNamespace='http://gumartinm.name/spring-ws/example']">
+ <!--
+ Perhaps it would be better to relay on the package generated automatically from WSDL
+ In a real project, I guess, I should use the package generated from WSDL file...
+ -->
<jaxb:schemaBindings>
- <jaxb:package name="de.spring.webservices.auto"/>
+ <jaxb:package name="de.spring.webservices.client.auto"/>
</jaxb:schemaBindings>
<jaxb:bindings node="//xs:element[@name='CustomBindingExampleRequest']/xs:complextype">
</xs:all>
</xs:complexType>
</xs:element>
- <xs:element name="ExampleFault">
- <xs:complexType>
- <xs:sequence>
- <xs:element name="technicalError" type="xs:string"/>
- <xs:element maxOccurs="unbounded" minOccurs="0" name="elements" type="parent:element"/>
- </xs:sequence>
- </xs:complexType>
- </xs:element>
+ <xs:element name="ExampleFault" type="parent:generalFault"/>
<!-- Using custombinding.xjb instead of inheritance plugin.
</xs:all>
</xs:complexType>
</xs:element>
- <xs:element name="CustomBindingExampleFault">
- <xs:complexType>
- <xs:sequence>
- <xs:element name="technicalError" type="xs:string"/>
- <xs:element maxOccurs="unbounded" minOccurs="0" name="elements" type="parent:element"/>
- </xs:sequence>
- </xs:complexType>
- </xs:element>
+ <xs:element name="CustomBindingExampleFault" type="parent:generalFault"/>
<!-- Example of creating array list by means of XSD -->
<xs:complexType name="car">
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
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.");
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.");
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
* @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(
</xs:all>
</xs:complexType>
</xs:element>
- <xs:element name="ExampleFault">
- <xs:complexType>
- <xs:sequence>
- <xs:element name="technicalError" type="xs:string" />
- <xs:element name="elements" type="parent:element" minOccurs="0" maxOccurs="unbounded"/>
- </xs:sequence>
- </xs:complexType>
- </xs:element>
+ <xs:element name="ExampleFault" type="parent:generalFault" />
<!-- Using custombinding.xjb instead of inheritance plugin.
</xs:all>
</xs:complexType>
</xs:element>
- <xs:element name="CustomBindingExampleFault">
- <xs:complexType>
- <xs:sequence>
- <xs:element name="technicalError" type="xs:string" />
- <xs:element name="elements" type="parent:element" minOccurs="0" maxOccurs="unbounded"/>
- </xs:sequence>
- </xs:complexType>
- </xs:element>
+ <xs:element name="CustomBindingExampleFault" type="parent:generalFault" />
<!-- Example of creating array list by means of XSD -->
<xs:complexType name="car">
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.
-->
- <oxm:jaxb2-marshaller id="marshaller" context-path="de.spring.webservices.auto"/>
+ <bean id="marshaller" class="org.springframework.oxm.jaxb.Jaxb2Marshaller">
+ <!--
+ contextPath because of Examples autogenerated class, which is an @Weberservice interface.
+ -->
+ <property name="contextPath" value="de.spring.webservices.client.auto:name.gumartinm.spring_ws.parent"/>
+ </bean>
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)
<properties>
<project.xsd.schemas.source.path>src/main/resources</project.xsd.schemas.source.path>
<project.xsd.schemas.target.path>${basedir}/target/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.xsd.schemas.package.name>de.spring.webservices.parent.auto</project.xsd.schemas.package.name>
<project.bindings.path>src/main/build-resources/bindings</project.bindings.path>
</properties>
<xs:element name="messageArgs" type="xs:string" minOccurs="0" maxOccurs="100"/>
</xs:sequence>
</xs:complexType>
+
+ <xs:complexType name="generalFault">
+ <xs:sequence>
+ <xs:element name="technicalError" type="xs:string" />
+ <xs:element name="elements" type="parent:element" minOccurs="0" maxOccurs="unbounded"/>
+ </xs:sequence>
+ </xs:complexType>
</xs:schema>
<jetty.version>9.3.0.RC0</jetty.version>
<project.xsd.schemas.source.path>src/main/resources</project.xsd.schemas.source.path>
<project.xsd.schemas.target.path>${basedir}/target/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.xsd.schemas.package.name>de.spring.webservices.server.auto</project.xsd.schemas.package.name>
<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>
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;
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);
}
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);
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 {
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")
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;
</xs:all>
</xs:complexType>
</xs:element>
- <xs:element name="ExampleFault">
- <xs:complexType>
- <xs:sequence>
- <xs:element name="technicalError" type="xs:string" />
- <xs:element name="elements" type="parent:element" minOccurs="0" maxOccurs="unbounded"/>
- </xs:sequence>
- </xs:complexType>
- </xs:element>
+ <xs:element name="ExampleFault" type="parent:generalFault" />
<!-- Using custombinding.xjb instead of inheritance plugin.
</xs:all>
</xs:complexType>
</xs:element>
- <xs:element name="CustomBindingExampleFault">
- <xs:complexType>
- <xs:sequence>
- <xs:element name="technicalError" type="xs:string" />
- <xs:element name="elements" type="parent:element" minOccurs="0" maxOccurs="unbounded"/>
- </xs:sequence>
- </xs:complexType>
- </xs:element>
+ <xs:element name="CustomBindingExampleFault" type="parent:generalFault" />
<!-- Example of creating array list by means of XSD -->
<xs:complexType name="car">
2. Especificando el context-path para ser escaneado por Spring usando anotaciones. Esto
se hace de este modo:
- <oxm:jaxb2-marshaller id="marshaller" context-path="de.spring.webservices.auto"/>
+ <oxm:jaxb2-marshaller id="marshaller" context-path="de.spring.webservices.server.auto"/>
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.
en globalxsds (quizás incluso basado en el namespace del xsd) y así podría evitar esta configuración.
-->
<bean id="marshaller" class="org.springframework.oxm.jaxb.Jaxb2Marshaller">
- <property name="packagesToScan" value="de.spring.webservices.auto"/>
+ <!--
+ cxf-xjc-plugin generates again the objects in web-services-spring-cxf-globalxsds :(
+ So we MAY NOT scan everything because there is more than one class representing
+ the same XML element. :(
+ -->
+ <property name="packagesToScan" value="de.spring.webservices.server.auto"/>
</bean>
<!-- Searches for @PayloadRoot -->
<sws:annotation-driven marshaller="marshaller" unmarshaller="marshaller" />
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;
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;
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 {
<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.xsd.schemas.package.name>de.spring.webservices.client.auto</project.xsd.schemas.package.name>
<project.bindings.path>src/main/build-resources/bindings</project.bindings.path>
</properties>
</xs:all>
</xs:complexType>
</xs:element>
- <xs:element name="ExampleFault">
- <xs:complexType>
- <xs:sequence>
- <xs:element name="technicalError" type="xs:string"/>
- <xs:element maxOccurs="unbounded" minOccurs="0" name="elements" type="parent:element"/>
- </xs:sequence>
- </xs:complexType>
- </xs:element>
+ <xs:element name="ExampleFault" type="parent:generalFault"/>
<!-- Using custombinding.xjb instead of inheritance plugin.
</xs:all>
</xs:complexType>
</xs:element>
- <xs:element name="CustomBindingExampleFault">
- <xs:complexType>
- <xs:sequence>
- <xs:element name="technicalError" type="xs:string"/>
- <xs:element maxOccurs="unbounded" minOccurs="0" name="elements" type="parent:element"/>
- </xs:sequence>
- </xs:complexType>
- </xs:element>
+ <xs:element name="CustomBindingExampleFault" type="parent:generalFault"/>
<!-- Example of creating array list by means of XSD -->
<xs:complexType name="car">
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
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
</xs:all>
</xs:complexType>
</xs:element>
- <xs:element name="ExampleFault">
- <xs:complexType>
- <xs:sequence>
- <xs:element name="technicalError" type="xs:string" />
- <xs:element name="elements" type="parent:element" minOccurs="0" maxOccurs="unbounded"/>
- </xs:sequence>
- </xs:complexType>
- </xs:element>
+ <xs:element name="ExampleFault" type="parent:generalFault" />
<!-- Using custombinding.xjb instead of inheritance plugin.
</xs:all>
</xs:complexType>
</xs:element>
- <xs:element name="CustomBindingExampleFault">
- <xs:complexType>
- <xs:sequence>
- <xs:element name="technicalError" type="xs:string" />
- <xs:element name="elements" type="parent:element" minOccurs="0" maxOccurs="unbounded"/>
- </xs:sequence>
- </xs:complexType>
- </xs:element>
+ <xs:element name="CustomBindingExampleFault" type="parent:generalFault" />
<!-- Example of creating array list by means of XSD -->
<xs:complexType name="car">
en globalxsds (quizás incluso basado en el namespace del xsd) y así podría evitar esta configuración.
-->
<bean id="marshaller" class="org.springframework.oxm.jaxb.Jaxb2Marshaller">
- <property name="packagesToScan" value="de.spring.webservices.auto"/>
+ <!--
+ maven-jaxb2-plugin for WSDL DOES generate again the objects in web-services-spring-jaxb2-globalxsds :(
+ So we MAY NOT scan everything because there is more than one class representing
+ the same XML element. :(
+ -->
+ <property name="packagesToScan" value="de.spring.webservices.client.auto"/>
</bean>
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)
<properties>
<project.xsd.schemas.source.path>src/main/resources/schemas</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.xsd.schemas.package.name>de.spring.webservices.parent.auto</project.xsd.schemas.package.name>
<project.bindings.path>src/main/build-resources/bindings</project.bindings.path>
</properties>
<xs:element name="messageArgs" type="xs:string" minOccurs="0" maxOccurs="100"/>
</xs:sequence>
</xs:complexType>
+
+ <xs:complexType name="generalFault">
+ <xs:sequence>
+ <xs:element name="technicalError" type="xs:string" />
+ <xs:element name="elements" type="parent:element" minOccurs="0" maxOccurs="unbounded"/>
+ </xs:sequence>
+ </xs:complexType>
</xs:schema>
<jetty.version>9.3.0.RC0</jetty.version>
<project.xsd.schemas.source.path>src/main/resources/schemas</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.xsd.schemas.package.name>de.spring.webservices.server.auto</project.xsd.schemas.package.name>
<project.bindings.path>src/main/build-resources/bindings</project.bindings.path>
</properties>
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;
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);
}
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);
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 {
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")
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;
</xs:all>
</xs:complexType>
</xs:element>
- <xs:element name="ExampleFault">
- <xs:complexType>
- <xs:sequence>
- <xs:element name="technicalError" type="xs:string" />
- <xs:element name="elements" type="parent:element" minOccurs="0" maxOccurs="unbounded"/>
- </xs:sequence>
- </xs:complexType>
- </xs:element>
+ <xs:element name="ExampleFault" type="parent:generalFault" />
<!-- Using custombinding.xjb instead of inheritance plugin.
</xs:all>
</xs:complexType>
</xs:element>
- <xs:element name="CustomBindingExampleFault">
- <xs:complexType>
- <xs:sequence>
- <xs:element name="technicalError" type="xs:string" />
- <xs:element name="elements" type="parent:element" minOccurs="0" maxOccurs="unbounded"/>
- </xs:sequence>
- </xs:complexType>
- </xs:element>
+ <xs:element name="CustomBindingExampleFault" type="parent:generalFault" />
<!-- Example of creating array list by means of XSD -->
<xs:complexType name="car">
2. Especificando el context-path para ser escaneado por Spring usando anotaciones. Esto
se hace de este modo:
- <oxm:jaxb2-marshaller id="marshaller" context-path="de.spring.webservices.auto"/>
+ <oxm:jaxb2-marshaller id="marshaller" context-path="de.spring.webservices.server.auto"/>
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.
en globalxsds (quizás incluso basado en el namespace del xsd) y así podría evitar esta configuración.
-->
<bean id="marshaller" class="org.springframework.oxm.jaxb.Jaxb2Marshaller">
- <property name="packagesToScan" value="de.spring.webservices.auto"/>
+ <!--
+ maven-jaxb2-plugin does NOT generate again the objects in web-services-spring-jaxb2-globalxsds
+ So we MAY scan everything and there is no trouble because there is not more than one class representing
+ the same XML element.
+ -->
+ <property name="packagesToScan" value="de.spring.webservices"/>
</bean>
<!-- Searches for @PayloadRoot -->
<sws:annotation-driven marshaller="marshaller" unmarshaller="marshaller" />
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;
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;
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 {