Note that there are some explanatory texts on larger screens.

plurals
  1. POSpring Map a file to a Url / URI
    primarykey
    data
    text
    <p>I have a spring webservice for which I have the schema in a directory as:</p> <ul> <li>WebRoot/DataContract/person.xsd</li> <li>WebRoot/DataContract/sub-person.xsd</li> </ul> <p>Where sub-person.xsd is included in person.xsd that is:</p> <p>in Person.xsd: </p> <pre><code>&lt;xsd:import namespace="http://www.mynamespace.org/xml/sub-person" schemaLocation="sub-person.xsd"/&gt; </code></pre> <p>I have defined the wsdl as:</p> <pre><code>&lt;bean id="personserv" class="org.springframework.ws.wsdl.wsdl11.DefaultWsdl11Definition"&gt; &lt;property name="schemaCollection" ref="schemaCollection"/&gt; &lt;property name="portTypeName" value="personserv"/&gt; &lt;property name="locationUri" value="/ws/personnelService/"/&gt; &lt;property name="targetNamespace" value="http://www.mynamespace.org/definitions"/&gt; &lt;/bean&gt; </code></pre> <p>I can access the wsdl file using:</p> <p><a href="http://localhost:8080/myapp/ws/personnelService/personserv.wsdl" rel="nofollow noreferrer">http://localhost:8080/myapp/ws/personnelService/personserv.wsdl</a></p> <p>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 </p> <p><a href="http://localhost:8080/myapp/ws/personnelService/sub-person.xsd" rel="nofollow noreferrer">http://localhost:8080/myapp/ws/personnelService/sub-person.xsd</a></p> <p>my question is how can I make sub-person.xsd available at the that URI location ?</p> <p>I have also changed the location specified in person.xsd as:</p> <pre><code>&lt;xsd:import namespace="http://www.mynamespace.org/xml/sub-person" schemaLocation="/DataContract/sub-person.xsd"/&gt; </code></pre> <p>which the client then tried to find sub-person.xsd at:</p> <p><a href="http://localhost:8080/sub-person.xsd" rel="nofollow noreferrer">http://localhost:8080/sub-person.xsd</a> which isn't correct.</p> <p>Another attempt was:</p> <pre><code>&lt;xsd:import namespace="http://www.mynamespace.org/xml/sub-person" schemaLocation="DataContract/sub-person.xsd"/&gt; </code></pre> <p>which the client then tried to find sub-person.xsd at:</p> <p><a href="http://localhost:8080/myapp/ws/personnelService/DataContract/sub-person.xsd" rel="nofollow noreferrer">http://localhost:8080/myapp/ws/personnelService/DataContract/sub-person.xsd</a> </p>
    singulars
    1. This table or related slice is empty.
    plurals
    1. This table or related slice is empty.
    1. This table or related slice is empty.
    1. This table or related slice is empty.
 

Querying!

 
Guidance

SQuiL has stopped working due to an internal error.

If you are curious you may find further information in the browser console, which is accessible through the devtools (F12).

Reload