W3C home > Mailing lists > Public > xml-dist-app@w3.org > January 2002

Re: SOAP Encoding - Arrays

From: Simon Fell <soap@zaks.demon.co.uk>
Date: Thu, 31 Jan 2002 13:41:51 -0800
To: xml-dist-app@w3.org
Message-ID: <56ej5uooi7uvcleq79pjs6bbp34nt0paj0@4ax.com>
On Thu, 31 Jan 2002 16:32:18 -0500, in soap you wrote:

>> // schema defines array to be of type ns:arrayOfInt
>> <array enc:arraySize="10" enc:offset="5">
>> 	<item>25</item>
>> 	<item>35</item>
>> </array>
>> 
>> // schema defines array to be of type enc:Array
>> <array xsi:type="ns:arrayOfInt" enc:arraySize="2">
>> 	<item>10</item>
>> 	<item>20</item>
>> </array>
>> 
>> Where arrayOfInt is a type derived from soap-enc array, as described
>> in the WSDL spec. This allows arrays to be treated in a manner consist
>> with all the other type types that are part of the encoding spec.
>
>Does this work for arrays with compound values?
>
>David Cleary
>the Progress Company

wouldn't you have something like this ?

<complexType name="SOAPStruct">
    <all>
      <element name="varInt" type="xsd:int"/>
      <element name="varFloat" type="xsd:float"/>
      <element name="varString" type="xsd:string"/>
    </all>
</complexType>
<complexType name="ArrayOfSOAPStruct">
    <complexContent>
      <restriction base="soap-enc:Array">
	 <element name="item" type="tns:SOAPStruct" 
		minOccurs="0" maxOccurs="unbounded" />
        <attribute ref="soap-enc:arraySize"  />
	 <attribute ref="soap-enc:offset"  />
      </restriction>
    </complexContent>
</complexType>
<element name="array" type="tns:ArrayOfSOAPStruct" />


<array enc:arraySize="2">
<item>
	<varInt>1</varInt>
	<varFloat>1.0</varFloat>
	<varString>foo</varString>
</item>
<item>
	<varInt>2</varInt>
	<varFloat>2.0</varFloat>
	<varString>bar</varString>
</item>
</array>

Cheers
Simon
Received on Thursday, 31 January 2002 16:42:14 GMT

This archive was generated by hypermail 2.2.0+W3C-0.50 : Monday, 7 December 2009 10:59:06 GMT