Bug #79210 [NEW]: WSDL maxOccurs/minOccurs attributes are ignored when set in 'sequence' node

From: Date: Sat, 01 Feb 2020 23:16:35 +0000
Subject: Bug #79210 [NEW]: WSDL maxOccurs/minOccurs attributes are ignored when set in 'sequence' node
Groups: php.bugs 
Request: Send a blank email to php-bugs+get-225294@lists.php.net to get a copy of this message
From: carlos dot godo at outlook dot com Operating system: ubuntu18.04 PHP version: 7.2.27 Package: SOAP related Bug Type: Bug Bug description:WSDL maxOccurs/minOccurs attributes are ignored when set in 'sequence' node 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 bug report at https://bugs.php.net/bug.php?id=79210&edit=1 -- Fix committed: https://bugs.php.net/fix.php?id=79210&r=fixed Fixed in release: https://bugs.php.net/fix.php?id=79210&r=alreadyfixed Need backtrace: https://bugs.php.net/fix.php?id=79210&r=needtrace Need Reproduce Script: https://bugs.php.net/fix.php?id=79210&r=needscript Try newer version: https://bugs.php.net/fix.php?id=79210&r=oldversion Not developer issue: https://bugs.php.net/fix.php?id=79210&r=support Expected behavior: https://bugs.php.net/fix.php?id=79210&r=notwrong Not enough info: https://bugs.php.net/fix.php?id=79210&r=notenoughinfo Submitted twice: https://bugs.php.net/fix.php?id=79210&r=submittedtwice register_globals: https://bugs.php.net/fix.php?id=79210&r=globals PHP version support discontinued: https://bugs.php.net/fix.php?id=79210&r=phptooold Daylight Savings: https://bugs.php.net/fix.php?id=79210&r=dst IIS Stability: https://bugs.php.net/fix.php?id=79210&r=isapi Install GNU Sed: https://bugs.php.net/fix.php?id=79210&r=gnused Floating point limitations: https://bugs.php.net/fix.php?id=79210&r=float No Zend Extensions: https://bugs.php.net/fix.php?id=79210&r=nozend MySQL Configuration Error: https://bugs.php.net/fix.php?id=79210&r=mysqlcfg

« previous php.bugs (#225294) next »