Just encountered this issue and would like to share how it is done as I couldn't find it in the reference doc or in this forum.
This issue is supposed to be fixed in 1.5.3 as per JIRAs
http://jira.springframework.org/browse/SWS-281 and
http://jira.springframework.org/browse/SWS-346. Unfortunately, an example is not given or even the handler class name. Anyway, here is one approach.
Code:
<bean id="MyService" class="org.springframework.ws.wsdl.wsdl11.SimpleWsdl11Definition">
<constructor-arg value="/wsdl/MyService.wsdl"/>
</bean>
<bean id="MySchemaA" class="org.springframework.xml.xsd.SimpleXsdSchema">
<property name="xsd" value="/wsdl/MySchemaA.xsd" />
</bean>
<bean id="MySchemaB" class="org.springframework.xml.xsd.SimpleXsdSchema">
<property name="xsd" value="/wsdl/MySchemaB.xsd" />
</bean>
where MyService imports MySchemaA and MySchemaA imports MySchemaB. Then all of them are exposed based on their bean names i.e.
http://someUrl/someContext/MyService.wsdl,
http://someUrl/someContext/MySchemaA.xsd,
http://someUrl/someContext/MySchemaB.xsd.
Yes, it is that simple but it took me sometime to figure it out. I initially thought that you still need to declare as a bean the handler like
Code:
<bean lass="org.springframework.ws.transport.http.XsdSchemaHandlerAdapter"/>
so I had to find out the handler class name and how it is supposed to work. But after checking the MessageDispatcherServlet code, it creates that handler automatically for you if none is found. In the end, it is just a matter of declaring the schemas together with SimpleWsdl11Definition.
This is just one approach. Maybe CommonsXsdSchemaCollection can also be used but haven't tried it.
Hope this helps.
Arjen, if this is the correct approach to expose imported XSDs, perhaps it could be mentioned in Section 5.3 of the reference doc? It would save a lot of time to those new to this.
Thanks.