Note that there are some explanatory texts on larger screens.

plurals
  1. PO
    text
    copied!<p>You have a couple of problems here. </p> <p>First, the XSD has an issue where an element is both named or referenced; in your case should be referenced.</p> <p>Change:</p> <pre><code>&lt;xsd:element name="stock" ref="Stock" minOccurs="1" maxOccurs="unbounded"/&gt; </code></pre> <p>To:</p> <pre><code>&lt;xsd:element name="stock" type="Stock" minOccurs="1" maxOccurs="unbounded"/&gt; </code></pre> <p>And:</p> <ul> <li>Remove the declaration of the global element <code>Stock</code></li> <li>Create a complex type declaration for a type named <code>Stock</code></li> </ul> <p>So:</p> <pre><code>&lt;xsd:element name="Stock"&gt; &lt;xsd:complexType&gt; </code></pre> <p>To:</p> <pre><code>&lt;xsd:complexType name="Stock"&gt; </code></pre> <p>Make sure you fix the xml closing tags.</p> <p>The second problem is that the correct way to reference an external XSD is to use XSD schema with import/include within a wsdl:types element. wsdl:import is reserved to referencing other WSDL files. More information is available by going through the WS-I specification, section <a href="http://www.ws-i.org/profiles/basicprofile-1.1-2004-08-24.html#WSDL_and_Schema_Import" rel="nofollow noreferrer">WSDL and Schema Import</a>. Based on WS-I, your case would be:</p> <p><strong>INCORRECT:</strong> (the way you showed it)</p> <pre><code>&lt;?xml version="1.0" encoding="UTF-8"?&gt; &lt;definitions targetNamespace="http://stock.com/schemas/services/stock/wsdl" .....xmlns:external="http://stock.com/schemas/services/stock" &lt;import namespace="http://stock.com/schemas/services/stock" location="Stock.xsd" /&gt; &lt;message name="getStockQuoteResp"&gt; &lt;part name="parameters" element="external:getStockQuoteResponse" /&gt; &lt;/message&gt; &lt;/definitions&gt; </code></pre> <p><strong>CORRECT:</strong></p> <pre><code>&lt;?xml version="1.0" encoding="UTF-8"?&gt; &lt;definitions targetNamespace="http://stock.com/schemas/services/stock/wsdl" .....xmlns:external="http://stock.com/schemas/services/stock" &lt;types&gt; &lt;schema xmlns="http://www.w3.org/2001/XMLSchema"&gt; &lt;import namespace="http://stock.com/schemas/services/stock" schemaLocation="Stock.xsd" /&gt; &lt;/schema&gt; &lt;/types&gt; &lt;message name="getStockQuoteResp"&gt; &lt;part name="parameters" element="external:getStockQuoteResponse" /&gt; &lt;/message&gt; &lt;/definitions&gt; </code></pre> <p><strong>SOME</strong> processors may support both syntaxes. The XSD you put out shows issues, make sure you first validate the XSD.</p> <p>It would be better if you go the WS-I way when it comes to WSDL authoring. </p> <p>Other issues may be related to the use of relative vs. absolute URIs in locating external content. </p>
 

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