Bug #78749 [Opn->Fbk]: Wrong error message when maxOccurs is exceeded

From: Date: Thu, 24 Oct 2019 19:43:07 +0000
Subject: Bug #78749 [Opn->Fbk]: Wrong error message when maxOccurs is exceeded
References: 1  Groups: php.bugs 
Request: Send a blank email to php-bugs+get-223454@lists.php.net to get a copy of this message
Edit report at https://bugs.php.net/bug.php?id=78749&edit=1 ID: 78749 Updated by: requinix@php.net Reported by: tony at marston-home dot demon dot co dot uk Summary: Wrong error message when maxOccurs is exceeded -Status: Open +Status: Feedback Type: Bug Package: SOAP related Operating System: Windows 10 PHP Version: 7.3.11 Block user comment: N Private report: N New Comment: Thank you for this bug report. To properly diagnose the problem, we need a short but complete example script to be able to reproduce this bug ourselves. A proper reproducing script starts with <?php and ends with ?>, is max. 10-20 lines long and does not require any external resources such as databases, etc. If the script requires a database to demonstrate the issue, please make sure it creates all necessary tables, stored procedures etc. Please avoid embedding huge scripts into the report. I may be misreading the source, but it looks like you're triggering a code path that only occurs when there is no value available. Previous Comments: ------------------------------------------------------------------------ [2019-10-24 18:29:46] tony at marston-home dot demon dot co dot uk Description: ------------ In my WSDL I have a complexType entry which has a maxOccurs set to 1. If I exceed this limit the error message says "SOAP-ERROR: Encoding object has no 'first_name' property" where 'first_name' is the first required field in the enclosed structure. Test script: --------------- WSDL: <xsd:complexType name="ArrayOfContactInfo"> <xsd:sequence> <xsd:element name="contact" type="tns:contact" minOccurs="0" maxOccurs="1"/> </xsd:sequence> </xsd:complexType> <xsd:complexType name="contact"> <xsd:all> <xsd:element name="title" type="xsd:string" minOccurs="0" maxOccurs="1"/> <xsd:element name="first_name" type="xsd:string" minOccurs="1" maxOccurs="1"/> <xsd:element name="middle_name" type="xsd:string" minOccurs="0" maxOccurs="1"/> <xsd:element name="last_name" type="xsd:string" minOccurs="1" maxOccurs="1"/> </xsd:all> </xsd:complexType> Expected result: ---------------- I expect a more meaningful error message such as "More than N occurrences exceeded" Actual result: -------------- The error message is totally misleading. ------------------------------------------------------------------------ -- Edit this bug report at https://bugs.php.net/bug.php?id=78749&edit=1

« previous php.bugs (#223454) next »