PEAR::SOAP - Nested complex types - Is it possible?
| From: | Gendron Bruno | Date: | Wed, 09 Jul 2003 21:05:37 +0000 |
| Subject: | PEAR::SOAP - Nested complex types - Is it possible? | ||
| Groups: | php.soap | ||
| Request: | Send a blank email to php-soap+get-766@lists.php.net to get a copy of this message | ||
Hi,
Supposing a web service that would return a message element of type FeatureCollection containing an
array of elements (ArrayofFeatures) of type Feature, as defined in the WSDL snippet below:
<types xmlns="http://schemas.xmlsoap.org/wsdl/">
<schema xmlns="http://www.w3.org/2001/XMLSchema"
targetNamespace="http://mynamespace.net">
<complexType name="FeatureCollection">
<sequence>
<element name="count" type="xsd:int"
<element name="features" type="ArrayOfFeatures" />
</sequence>
</complexType>
<complexType name="ArrayOfFeatures">
<complexContent>
<restriction base="SOAP-ENC:arrayType">
<attribute ref="SOAP-ENC:arrayType" arrayType="Feature[]" />
</restriction>
</complexContent>
</complexType>
<complexType name="Feature">
<sequence>
<element name="distance" type="xsd:float" />
<element name="x" type="xsd:float" />
<element name="y" type="xsd:float" />
</sequence>
</complexType>
</schema>
</types>
Is the PEAR::SOAP implementation capable of handling such complex types? If not, I would have to
rely on some other SOAP implementation...
If so, how would you proceed to define such element types in the server in order to use PEAR::SOAP
WSDL generation capabilities (I have looked carefuly through the examples and documentation, without
being able to figure out)? Also, how would you create such a FeatureCollection element in order to
be able to send it back from the PHP server? I understand the process for simple types (return
$somestring;) of "simple" complex types, but for nested complex types?
Many thanks...
----
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