Package home | Report new bug | New search | Development Roadmap Status: Open | Feedback | All | Closed Since Version 0.14.0

Bug #18093 SOAP_Value type wrongly set to array
Submitted: 2010-12-03 00:05 UTC
From: newaira Assigned:
Status: Open Package: SOAP (version 0.12.0)
PHP Version: 5.2.12 OS: Win7
Roadmaps: (Not assigned)    
Subscription  


 [2010-12-03 00:05 UTC] newaira (Andrej Pavlovic)
Description: ------------ SOAP_Value with an array of exactly two nested SOAP_Values is always forced to type Array, and doesn't use a specified type. The bug can be traced to Base.php on line 650: // For non-wsdl structs that are all the same type reset($value); ---> $value1 = next($value); $value2 = next($value); Replace: $value1 = next($value); With: $value1 = current($value); Test script: --------------- new SOAP_Value( 'authentication', '{Authentication}local', array ( new SOAP_Value( 'user', 'string', 'myusername' ), new SOAP_Value( 'password', 'string', 'mypassword' ), ) ), Expected result: ---------------- <authentication xsi:type="ns5:local"> <user xsi:type="xsd:string">myusername</user> <password xsi:type="xsd:string">mypassword</password> </authentication> Actual result: -------------- <authentication xsi:type="SOAP-ENC:Array" SOAP-ENC:arrayType="xsd:string[2]"> <user xsi:type="xsd:string">myusername</user> <password xsi:type="xsd:string">mypassword</password> </authentication>

Comments