I am writing SoapServer with PHP 5.2 to return a job list to another application. My WSDL document requires a complex type in the following lines:
<xsd:element name="Vacancies"> <xsd:complexType> <xsd:sequence> <xsd:element name="Vacancy" type="ns:VacancyType" minOccurs="0" maxOccurs="unbounded"></xsd:element> </xsd:sequence> </xsd:complexType> </xsd:element>
My function generates a large nested array to build each vacancy and then returns an array of arrays (i.e.: vacancies) in SoapServer.
Unfortunately, every array is indexed. Therefore, each VacancyType item in the Jobs section has a unique index. This seems to disable the WSDL definition, and the data returned to me simply causes a parsing error. I usually use associative arrays for key pair values, but since I am dealing with n VacancyType instances that will not work because there would be no unique reference.
Is there a known workaround for such a scenario (for example, perhaps an object), or should I rework my WSDL document to process indexed arrays?
thanks
source share