|
php.net | support | documentation | report a bug | advanced search | search howto | statistics | random bug | login |
[2006-01-31 13:24 UTC] say_ten at multiplay dot co dot uk
Description:
------------
When using the following WSDL reponse the server is allowed to return 0 to many recipes.
<xsd:complexType name="getRecipesResponse_t">
<xsd:sequence>
<xsd:element name="recipes" type="types:Recipe" minOccurs="0" maxOccurs="unbounded" />
</xsd:sequence>
</xsd:complexType>
The code returned from the function would be of the type:
array( array( "id" => 3, "recipe" => cake, "description" => "desc" ) );
If their is only 1 recipe the client returns a standard object of the recipe. If there's more than one, the client returns an array of recipes. This inconsitency results in code to detect and wrap the std class into an array for compatibility with the following code, foreach() for example. This is also true when passing arrays of arrays to the SOAP server.
Expected result:
----------------
I would expect the single element arrays passed in to remain single element arrays at the other end.
PatchesPull RequestsHistoryAllCommentsChangesGit/SVN commits
|
|||||||||||||||||||||||||||
Copyright © 2001-2025 The PHP GroupAll rights reserved. |
Last updated: Wed Oct 29 04:00:01 2025 UTC |
This is not a bug but feature. I stayed the default behavior unchanged, but added ability to create arrays even if only one element exists. To create arrays with single element, you should use special option in SoapServer/SoapClient constructor. $x = new SoapClient($wsdl, array('features' => SOAP_SINGLE_ELEMENT_ARRAYS)); Fixed in CVS HEAD and PHP_5_1.