|
php.net | support | documentation | report a bug | advanced search | search howto | statistics | random bug | login |
PatchesPull RequestsHistoryAllCommentsChangesGit/SVN commits
[2020-02-01 23:25 UTC] requinix@php.net
-Status: Open
+Status: Duplicate
[2020-02-01 23:25 UTC] requinix@php.net
[2020-02-02 00:28 UTC] carlos dot godo at outlook dot com
[2020-02-02 01:00 UTC] requinix@php.net
-Status: Duplicate
+Status: Open
[2020-02-02 01:00 UTC] requinix@php.net
[2020-02-02 01:21 UTC] carlos dot godo at outlook dot com
[2020-02-02 01:39 UTC] requinix@php.net
|
|||||||||||||||||||||||||||||||||||||
Copyright © 2001-2025 The PHP GroupAll rights reserved. |
Last updated: Wed Nov 05 14:00:01 2025 UTC |
Description: ------------ When parsing WSDL, SoapClient ignores maxOccurs or minOccurs attributes when they are set on the 'sequence' node, instead of on the 'element' node. Below there's an example of a WSDL type that causes the issue. See that the 'sequence' element for "persons" has maxOccurs="unbounded". <element name="persons"> <complexType> <sequence maxOccurs="unbounded"> <element name="person"> <complexType> <sequence> <element name="full_name" type="xsd:string"/> </sequence> </complexType> </element> </sequence> </complexType> </element> The data that would match this complexType would be: $data = (object)[ 'persons' => (object)[ 'person' => [ (object)['full_name' => 'Person One'], (object)['full_name' => 'Person Two'], (object)['full_name' => 'Person Three'], ] ], ]; However, since maxOccurs is ignored, SoapClient expects "person" to be an object containing a 'full_name' property. Since instead it finds an array, it fails with the following error: SOAP-ERROR: Encoding: object has no 'full_name' property. Expected result: ---------------- <persons> <person> <full_name>Person One</full_name> </person> <person> <full_name>Person Two</full_name> </person> <person> <full_name>Person Three</full_name> </person> </persons> Actual result: -------------- SOAP-ERROR: Encoding: object has no 'full_name' property