I have a spring webservice for which I have the schema in a directory as:
- WebRoot/DataContract/person.xsd
- WebRoot/DataContract/sub-person.xsd
Where sub-person.xsd is included in person.xsd that is:
in Person.xsd:
<xsd:import namespace="http://www.mynamespace.org/xml/sub-person"
schemaLocation="sub-person.xsd"/>
I have defined the wsdl as:
<bean id="personserv" class="org.springframework.ws.wsdl.wsdl11.DefaultWsdl11Definition">
<property name="schemaCollection" ref="schemaCollection"/>
<property name="portTypeName" value="personserv"/>
<property name="locationUri" value="/ws/personnelService/"/>
<property name="targetNamespace" value="http://www.mynamespace.org/definitions"/>
</bean>
I can access the wsdl file using:
http://localhost:8080/myapp/ws/personnelService/personserv.wsdl
However, when making use of this wsdl the client can fetch person.xsd and cannot fetch sub-person.xsd giving an error failed to load
http://localhost:8080/myapp/ws/personnelService/sub-person.xsd
my question is how can I make sub-person.xsd available at the that URI location ?
I have also changed the location specified in person.xsd as:
<xsd:import namespace="http://www.mynamespace.org/xml/sub-person"
schemaLocation="/DataContract/sub-person.xsd"/>
which the client then tried to find sub-person.xsd at:
http://localhost:8080/sub-person.xsd which isn't correct.
Another attempt was:
<xsd:import namespace="http://www.mynamespace.org/xml/sub-person"
schemaLocation="DataContract/sub-person.xsd"/>
which the client then tried to find sub-person.xsd at:
http://localhost:8080/myapp/ws/personnelService/DataContract/sub-person.xsd