Bug #79210 [Opn->Dup]: WSDL maxOccurs/minOccurs attributes are ignored when set in 'sequence' node

From: Date: Sat, 01 Feb 2020 23:25:35 +0000
Subject: Bug #79210 [Opn->Dup]: WSDL maxOccurs/minOccurs attributes are ignored when set in 'sequence' node
References: 1  Groups: php.bugs 
Request: Send a blank email to php-bugs+get-225295@lists.php.net to get a copy of this message
Edit report at https://bugs.php.net/bug.php?id=79210&edit=1 ID: 79210 Updated by: requinix@php.net Reported by: carlos dot godo at outlook dot com Summary: WSDL maxOccurs/minOccurs attributes are ignored when set in 'sequence' node -Status: Open +Status: Duplicate Type: Bug Package: SOAP related Operating System: ubuntu18.04 PHP Version: 7.2.27 Block user comment: N Private report: N New Comment: Duplicate of bug #78749 Previous Comments: ------------------------------------------------------------------------ [2020-02-01 23:16:35] carlos dot godo at outlook dot com 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 ------------------------------------------------------------------------ -- Edit this bug report at https://bugs.php.net/bug.php?id=79210&edit=1

« previous php.bugs (#225295) next »