Lots of Web Services using SOAP contain XML Schema type definitions like this:
 
      <xsd:complexType name="ResultElementArray">
        <xsd:complexContent>
          <xsd:restriction base="soapenc:Array">
             <xsd:attribute ref="soapenc:arrayType" wsdl:arrayType="typens:ResultElement[]"/>
          </xsd:restriction>
        </xsd:complexContent>
      </xsd:complexType>
 
(The base type is given below).
 
When a SOAP/WSDL processor reads this type, it can determine via special knowledge (out of band as far as WXS is concerned) based on presence of the soapenc:arrayType attribute and the wsdl:arrayType attribute value that an element of type ResultElementArray may contain an unrestricted number of child elements (with any name allowed -- see the base type) of type ResultElement.
 
When an instance document is encountered, it might look like this
<return arrayType="ResultElement[3]" xsi:type="ResultElementArray">
   <item xsi:type="ResultElement">...</item>
   <item xsi:type="ResultElement">...</item>
   <item xsi:type="ResultElement">...</item>
</return>
and the SOAP processor can determine from the arrayType value that there will be three child elements of type ResultElement.
 
The question is, if I get the grammar containing this type and convert it to an XSModel, how can I find the all-important wsdl:arrayType attribute value, (and thus be able to emulate the SOAP/WSDL processor's knowledge of the content, without having an instance document to look at)?  Is this information captured somewhere in the XSModel?  Is it possible to examine the contents of the restriction, rather than only determine the base type and the derivation method?
 
Jeff
 
Note:
The base type, somewhat simplified, is from the SOAP-Encoding spec:
  <xs:complexType name="Array" >
    <xs:sequence>
      <xs:any namespace="##any" minOccurs="0" maxOccurs="unbounded" processContents="lax" />
    </xs:sequence>
    <xs:attribute name="arrayType" type="xs:string" />
    <xs:attribute name="arrayOffset" type="xs:string"/>
    <xs:anyAttribute namespace="##other" processContents="lax" />
  </xs:complexType>

Reply via email to