Defining array of arbitrary type or sequence elements with PEAR::SOAP
| From: | Gendron Bruno | Date: | Tue, 22 Jul 2003 20:07:19 +0000 |
| Subject: | Defining array of arbitrary type or sequence elements with PEAR::SOAP | ||
| Groups: | php.soap | ||
| Request: | Send a blank email to php-soap+get-873@lists.php.net to get a copy of this message | ||
Hi,
Again, I'm posting this message hoping to resolve the following problem with PEAR::SOAP...
By following Michele Manzato recommandations, I managed to define the following complex types to be
used in automatic WSDL generation:
<complexType name="Point">
<all>
<element name="x" type="double" />
<element name="y" type="double" />
</all>
</complexType>
<complexType name="ResultSet">
<all>
<element name="Count" type="int" />
<element name="Feature" type="Point" />
</all>
</complexType>
As you can see (and, from what I know, it always seems to be the case with PEAR::SOAP), the script
returns my complex type as an <all><element/><element/>...</all> sequence,
and I'm stuck with only 1 "Feature"-type element in my ResultSet...
But what I really need is the following:
<complexType name="ArrayOfFeatures">
<complexContent>
<sequence>
<element name="Feature" minOccurs="0" maxOccurs="unbounded"
type="Point" />
<sequence>
<complexContent>
<complexType>
<complexType name="ResultSet">
<sequence>
<element name="Count" type="int" />
<element name="Features" nillable="true" type="ArrayOfFeatures"
/>
<sequence>
<complexType>
to be able to support more than 1 "Feature"-type element in my ResultSet...
As I asked yesterday on this list, being able to define an array of arbitrary type would also do the
trick:
<complexType name="ArrayOfFeatures">
<complexContent>
<restriction base="soapenc:Array">
<attribute ref="soapenc:arrayType" wsdl:arrayType="Feature" />
<restriction>
<complexContent>
<complexType>
Is this possible?
Thanks for your help
----
Bruno Gendron
Conseiller scientifique - Spécialiste en géomatique / Advisor - GIS Specialist
Chaire de recherche du Canada en études asiatiques / Canada Chair of Asian Research
Université de Montréal
3477, rue Jean-Brillant, bureau 530-26
C.P. 6128, Succ. Centre-ville
Montréal, QC, Canada, H3C 3J7
Tél : +1 514-343-5768
Fax (CETASE) : +1 514-343-7716
Web : http://www.caac.umontreal.ca