views:

306

answers:

0

Hi,

I am writing a SoapServer with PHP 5.2 to return a list of vacancies to another application. My WSDL doc requires a complex type along the lines of:

<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 is generating a large, nested array to assemble each vacancy and then returning the array of arrays (ie: vacancies) to the SoapServer.

Unfortunately, each array is indexed. So each VacancyType element within Vacancies has a unique index. This seems to throw the WSDL definition off and the data returned to me simply throws a parse error. I'd normally use associative arrays for key pair values, but as I'm dealing with n instances of VacancyType that wouldn't work as there wouldn't be a unique reference.

Is there a known workaround for this kind of scenario (eg: maybe an object), or should I rework my WSDL doc to cater for indexed arrays?

Thanks