Aller au contenu | Aller au menu | Aller à la recherche


PHP SOAP multiple return array or single element

PHP SOAP multiple element from WSDL minOccurs="0" maxOccurs="unbounded" return array or single element

SoapClient

The features option is a bitmask of these predefined SOAP Constants : SOAP_SINGLE_ELEMENT_ARRAYS, SOAP_USE_XSI_ARRAY_TYPE, SOAP_WAIT_ONE_WAY_CALLS.

Array problems with SOAP and PHP

Array problems with SOAP and PHP : When the back-end send an array with item count > 1 everything works fine. The problems start when there is only one item in the array.

PHP Bug #36226 Inconsistent handling when passing potential arrays, explain that this is not a bug, but a feature.

To get arrays containing one single element, simply create the SoapClient as follows:

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

Ajouter un commentaire

Le code HTML est affiché comme du texte et les adresses web sont automatiquement transformées.

Fil des commentaires de ce billet