PHP: SOAP and array’s

When the SOAP server send’s an array with item count > 1 everything works fine. When there is only one item in the array, the array is discarded and point’s straight to a single object. To get arrays containing one single element, simply create the SoapClient as follows:

$soap_client = new SoapClient($wsdl, array(‘features’=>SOAP_SINGLE_ELEMENT_ARRAYS));

Leave a Reply