From:             ianare at gmail dot com
Operating system: Linux 2.6.31
PHP version:      5.2.13RC1
PHP Bug Type:     SOAP related
Bug description:  Array elements not named properly when serialized to SOAP XML

Description:
------------
System info :
Ubuntu 9.10 (Karmic)
kernel 2.6.31
./configure --enable-soap
PHP 5.2.13RC1-dev (cli) (built: Feb  2 2010 12:40:11) (DEBUG)

Problem :
When an array is serialzed into XML to be sent as a SOAP request, the
naming of the array's elements do not match what is defined in the WSDL
file. Instead the elements are named 'item'.
This only happens to multidimensional arrays or an 'array within an object
within an array'. The top-level array's elements do get named properly.

Thank you.

Reproduce code:
---------------
There are two files. One is the test script, the other is the WSDL file.
Both can be downloaded from here:
http://file-folder-ren.sourceforge.net/dev_src/

Expected result:
----------------
This is the XML structure expected by the WSDL file. Note that the 
elements within 'criteria' are named 'criterion'.

<criterion xsi:type="groupCriterion">
<criteria>
  <criterion xsi:type="simpleCriterion">
    <key>id</key>
    <specimen xsi:type="stringSpecimen">
      <value>someValue</value>
    </specimen>
  </criterion>
  <criterion xsi:type="simpleCriterion">
    <key>id</key>
    <specimen xsi:type="stringSpecimen">
      <value>someValue</value>
    </specimen>
  </criterion>
</criteria>
<negated>false</negated>
<required>true</required>
</criterion>

Actual result:
--------------
This is the XML actually generated by the script. Note that the  elements
within 'criteria' are named 'item'. This gets rejected by the real
webservice the WSDL file used in this example was taken from.

<criterion xsi:type="groupCriterion">
<criteria>
  <item xsi:type="simpleCriterion">
    <key>id</key>
    <specimen xsi:type="stringSpecimen">
      <value>someValue</value>
    </specimen>
  </item>
  <item xsi:type="simpleCriterion">
    <key>id</key>
    <specimen xsi:type="stringSpecimen">
      <value>someValue</value>
    </specimen>
  </item>
</criteria>
<negated>false</negated>
<required>true</required>
</criterion>

-- 
Edit bug report at http://bugs.php.net/?id=50917&edit=1
-- 
Try a snapshot (PHP 5.2):            
http://bugs.php.net/fix.php?id=50917&r=trysnapshot52
Try a snapshot (PHP 5.3):            
http://bugs.php.net/fix.php?id=50917&r=trysnapshot53
Try a snapshot (PHP 6.0):            
http://bugs.php.net/fix.php?id=50917&r=trysnapshot60
Fixed in SVN:                        
http://bugs.php.net/fix.php?id=50917&r=fixed
Fixed in SVN and need be documented: 
http://bugs.php.net/fix.php?id=50917&r=needdocs
Fixed in release:                    
http://bugs.php.net/fix.php?id=50917&r=alreadyfixed
Need backtrace:                      
http://bugs.php.net/fix.php?id=50917&r=needtrace
Need Reproduce Script:               
http://bugs.php.net/fix.php?id=50917&r=needscript
Try newer version:                   
http://bugs.php.net/fix.php?id=50917&r=oldversion
Not developer issue:                 
http://bugs.php.net/fix.php?id=50917&r=support
Expected behavior:                   
http://bugs.php.net/fix.php?id=50917&r=notwrong
Not enough info:                     
http://bugs.php.net/fix.php?id=50917&r=notenoughinfo
Submitted twice:                     
http://bugs.php.net/fix.php?id=50917&r=submittedtwice
register_globals:                    
http://bugs.php.net/fix.php?id=50917&r=globals
PHP 4 support discontinued:          http://bugs.php.net/fix.php?id=50917&r=php4
Daylight Savings:                    http://bugs.php.net/fix.php?id=50917&r=dst
IIS Stability:                       
http://bugs.php.net/fix.php?id=50917&r=isapi
Install GNU Sed:                     
http://bugs.php.net/fix.php?id=50917&r=gnused
Floating point limitations:          
http://bugs.php.net/fix.php?id=50917&r=float
No Zend Extensions:                  
http://bugs.php.net/fix.php?id=50917&r=nozend
MySQL Configuration Error:           
http://bugs.php.net/fix.php?id=50917&r=mysqlcfg

Reply via email to