Note that there are some explanatory texts on larger screens.

plurals
  1. POHow do I decouple an embedded schema within a WSDL?
    primarykey
    data
    text
    <p>I am very new to Web services and I would like to know how one would go about saving types define in a wsdl:type section into it's own schema with the idea that one could reuse the schema within multiple WSDL. I have been trying to use the import statement as per below but this has not been very successful.</p> <pre><code> &lt;wsdl:types&gt; &lt;xsd:schema targetNamespace="http://ttdev.com/ss"&gt; &lt;xsd:import namespace="http://ttdev.com/ss"schemaLocation="http://ttdev.com/ss/SimpleService.xsd"/&gt; &lt;/xsd:schema&gt; &lt;/wsdl:types&gt; &lt;wsdl:definitions xmlns:soap="http://schemas.xmlsoap.org/wsdl/soap/" xmlns:tns="http://ttdev.com/ss" xmlns:wsdl="http://schemas.xmlsoap.org/wsdl/" xmlns:xsd="http://www.w3.org/2001/XMLSchema" name="SimpleService" targetNamespace="http://ttdev.com/ss" xmlns:xi="http://www.w3.org/2001/XInclude"&gt; &lt;wsdl:types&gt; &lt;xsd:schema targetNamespace="http://ttdev.com/ss"&gt; &lt;xsd:element name="concatRequest"&gt; &lt;xsd:complexType&gt; &lt;xsd:sequence&gt; &lt;xsd:element name="param1" type="xsd:string"/&gt; &lt;xsd:element name="param2" type="xsd:string"/&gt; &lt;/xsd:sequence&gt; &lt;/xsd:complexType&gt; &lt;/xsd:element&gt; &lt;xsd:element name="concatResponse"&gt; &lt;xsd:complexType&gt; &lt;xsd:sequence minOccurs="0" maxOccurs="100"&gt; &lt;xsd:element name="name" type="xsd:string"/&gt; &lt;xsd:element name="description" type="xsd:string"/&gt; &lt;/xsd:sequence&gt; &lt;/xsd:complexType&gt; &lt;/xsd:element&gt; &lt;/xsd:schema&gt; &lt;/wsdl:types&gt; &lt;wsdl:message name="concatRequest"&gt; &lt;wsdl:part name="parameters" element="tns:concatRequest"/&gt; &lt;/wsdl:message&gt; &lt;wsdl:message name="concatResponse"&gt; &lt;wsdl:part name="parameters" element="tns:concatResponse"/&gt; &lt;/wsdl:message&gt; &lt;wsdl:portType name="SimpleService"&gt; &lt;wsdl:operation name="concat"&gt; &lt;wsdl:input message="tns:concatRequest"/&gt; &lt;wsdl:output message="tns:concatResponse"/&gt; &lt;/wsdl:operation&gt; &lt;/wsdl:portType&gt; &lt;wsdl:binding name="SimpleServiceSOAP" type="tns:SimpleService"&gt; &lt;soap:binding style="document" transport="http://schemas.xmlsoap.org/soap/http"/&gt; &lt;wsdl:operation name="concat"&gt; &lt;soap:operation soapAction="http://ttdev.com/ss/NewOperation"/&gt; &lt;wsdl:input&gt; &lt;soap:body use="literal"/&gt; &lt;/wsdl:input&gt; &lt;wsdl:output&gt; &lt;soap:body use="literal"/&gt; &lt;/wsdl:output&gt; &lt;/wsdl:operation&gt; &lt;/wsdl:binding&gt; &lt;wsdl:service name="SimpleService"&gt; &lt;wsdl:port name="p1" binding="tns:SimpleServiceSOAP"&gt; &lt;soap:address location="http://localhost:8080/ss/p1"/&gt; &lt;/wsdl:port&gt; &lt;/wsdl:service&gt; &lt;/wsdl:definitions&gt; </code></pre> <p>To summarize:</p> <ol> <li>I have isolated the schema into its own file SinpleService.xsd (as per code sample below)</li> <li>I have added an import statement to the WSDL as per above.</li> <li>However it looks like types cannot be resolved when I reference them via the import.</li> </ol> <hr> <pre><code>&lt;?xml version="1.0"?&gt; &lt;xsd:schema xmlns:xsd="http://www.w3.org/2001/XMLSchema" xmlns:ns1="http://schemas.xmlsoap.org/soap/encoding/" xmlns:ns2="http://ttdev.com/ss" targetNamespace="http://ttdev.com/ss"&gt; &lt;xsd:import namespace="http://schemas.xmlsoap.org/soap/encoding/" schemaLocation="http://schemas.xmlsoap.org/soap/encoding/"/&gt; &lt;xsd:import namespace="http://www.w3.org/2001/XMLSchema"/&gt; &lt;xsd:element name="concatRequest"&gt; &lt;xsd:complexType&gt; &lt;xsd:sequence&gt; &lt;xsd:element name="param1" type="xsd:string"/&gt; &lt;xsd:element name="param2" type="xsd:string"/&gt; &lt;/xsd:sequence&gt; &lt;/xsd:complexType&gt; &lt;/xsd:element&gt; &lt;xsd:element name="concatResponse"&gt; &lt;xsd:complexType&gt; &lt;xsd:sequence minOccurs="0" maxOccurs="100"&gt; &lt;xsd:element name="name" type="xsd:string"/&gt; &lt;xsd:element name="description" type="xsd:string"/&gt; &lt;/xsd:sequence&gt; &lt;/xsd:complexType&gt; &lt;/xsd:element&gt; &lt;/xsd:schema&gt; </code></pre>
    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.
    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