Bug->Doc #43338 [Opn]: SoapEnc Arrays and Single Element Arrays

From: Date: Thu, 25 Mar 2021 11:19:34 +0000
Subject: Bug->Doc #43338 [Opn]: SoapEnc Arrays and Single Element Arrays
References: 1  Groups: php.doc.bugs 
Request: Send a blank email to doc-bugs+get-18668@lists.php.net to get a copy of this message
Edit report at https://bugs.php.net/bug.php?id=43338&edit=1 ID: 43338 Updated by: cmb@php.net Reported by: daniel dot seif at castex dot de Summary: SoapEnc Arrays and Single Element Arrays Status: Open -Type: Bug +Type: Documentation Problem Package: SOAP related Operating System: * PHP Version: 5.* Block user comment: N Private report: N New Comment: I can confirm the reported behavior with PHP-7.4. And while I agree that this doesn't look right, I'm afraid that changing this long standing behavior might cause more harm than good. Maybe the best course of action is to document that. Previous Comments: ------------------------------------------------------------------------ [2012-06-13 06:49:42] daniel dot seif at castex dot de Not sure, if this is the right way to let this issue pop up, but the problem is still not solved. Will this be fixed any time soon? ------------------------------------------------------------------------ [2010-07-22 03:01:15] daniel dot seif at castex dot de Since the problem exists in the 5.2 as well as in the 5.3 branch, I changed the affected PHP Version ------------------------------------------------------------------------ [2010-07-22 02:47:28] daniel dot seif at castex dot de Checked again against PHP 5.3.2, the issue is still unsolved. I created two php tests for this. One for wsdl-mode on (works as expected) and one for wsdl-mode off (erroneous as described here) You can download them here: http://castex.de/stuff/phpt-bug43338.zip Please do me a favor and take care of this issue. If I had enough knowledge, I'd try to submit a patch, but obviously I don't ... ------------------------------------------------------------------------ [2009-04-25 10:34:18] daniel dot seif at castex dot de It's still not working in 5.2.10-dev as of today. I tested it with the windows binary build from yesterday. I provided you a test-package, you can download it here: http://castex.de/stuff/php-bug43338.zip ------------------------------------------------------------------------ [2007-11-19 17:50:57] daniel dot seif at castex dot de Description: ------------ If a SoapServer-Object is instantiated with the option SOAP_SINGLE_ELEMENT_ARRAYS (to automatically get an array if defined in the wsdl) together with SOAP_USE_XSI_ARRAY_TYPE (to allow array types instead of wsdl types), an request sent with an SOAPEnc:Array will be transformed to an array with a "deepness" of 2. Reproduce code: --------------- class SoapHandler { function getSomething($arguments) { print_r($arguments); } } /** * SoapServer */ $server = new SoapServer($wsdl, array( 'uri' => $uri, 'features' => SOAP_USE_XSI_ARRAY_TYPE + SOAP_SINGLE_ELEMENT_ARRAYS)); $server->setClass('SoapHandler'); $server->handle(); /** * request **/ <SOAP-ENV:Envelope SOAP-ENV:encodingStyle="http://schemas.xmlsoap.org/soap/encoding/"> <SOAP-ENV:Body> <ns4848:getSomething> <arguments xsi:type="SOAP-ENC:Array" SOAP-ENC:arrayType="xsd:string[2]"> <item xsi:type="xsd:string">String 1</item> <item xsi:type="xsd:string">String 2</item> </arguments> </ns4848:getRouteMiles> </SOAP-ENV:Body> </SOAP-ENV:Envelope> Expected result: ---------------- Array ( [0] => String 1 [1] => String 2 ) Actual result: -------------- Array ( [0] => Array ( [0] => String 1 [1] => String 2 ) ) ------------------------------------------------------------------------ -- Edit this bug report at https://bugs.php.net/bug.php?id=43338&edit=1

« previous php.doc.bugs (#18668) next »