I have one module where I have my XSD schemas, where one schema can reference an other using relative path within schema location:
<xs:import namespace="http://my.namespace.org" schemaLocation="../mypackage/my.xsd"/>
Here I'm also using xjc to generate Jaxb beans from these xsd schemas.
Now I have a module where is my web-service is implemetented, using spring-ws (2.0.4). And I want to use static WSDL and publish it with the xsd schemas, where the schema locations will be transformed to URL like 'http://myerver.url.com/my.xsd'.
The question is how to elegantly achieve this?
(Alternatively combine the XSDs into one schema and that to WSDL)
(In theory I could transform these XSD using a script and add them to resources (xsd and wsdl) to a (spring dispatcher) servlet but it doesn't seems to me very comfortable)
Spring web service has a way to do it elegantly actually. All you need to do is to define a
SimpleXsdSchema
bean with the right id (which will be used as the xsd name without .xsd) in the bean definition xml file, something like belowMore information (including an example) can be found at the following link: Static WSDL with imported XML Schema in Spring Web Service
Below is the JAva config for exposing the schema. This worked for me. Please note that the schema name should match the Bean name and method name. This is very key for this to work. So i kept the XSD name and Bean name as "CustomerDetailsSchema" and make sure the constructor for getCustomerDetails also matches the name