I'm using Zend_Soap_Client and encountering this issue:
$client = new Zend_Soap_Client('url', array('wsdl'=>'url));
$result = $client->getResult();
Personally I do not see the need to use
Zend_Soap_Client instead of
SoapClient because the Zend version does not add anything beneficial, but on the other hand the solution applies to both:
There is an options array parameter in the original
SoapClient that accepts plenty of things, and especially this (see http://de3.php.net/manual/en/soapclient.soapclient.php):
The features option is a bitmask of SOAP_SINGLE_ELEMENT_ARRAYS,...
With this option, all array structures in the soap response are not reduced to one single element if they contain only one, but left as is. You are always accessing an array then, which is easier than switching depending on the content.