php.net |  support |  documentation |  report a bug |  advanced search |  search howto |  statistics |  random bug |  login
Bug #47647 Array types don't retain xsi:types for polymorphic types
Submitted: 2009-03-13 15:33 UTC Modified: 2013-02-18 00:33 UTC
Votes:4
Avg. Score:3.8 ± 0.8
Reproduced:4 of 4 (100.0%)
Same Version:0 (0.0%)
Same OS:2 (50.0%)
From: e dot mortoray at ecircle dot com Assigned:
Status: No Feedback Package: SOAP related
PHP Version: 5.2.9 OS: Linux
Private report: No CVE-ID: None
Have you experienced this issue?
Rate the importance of this bug to you:

 [2009-03-13 15:33 UTC] e dot mortoray at ecircle dot com
Description:
------------
The SOAPClient doesn't appear to handle Arrays containing polymorphic types correctly.

In this case (using the Seapine TestTrack API) we have an array of type "ArrayOfCField" according to the WSDL.  And if we obtain a result the XML encoding of this array looks like this:

<customFieldList xsi:type="SOAP-ENC:Array" SOAP-ENC:arrayType="ttns:CField[1]"><item xsi:type="ttns:CDropdownField"><recordid>363</recordid><name>Customer</name><value>Argos (C1407)</value></item></customFieldList>

But when using var_dump on the resulting structure we can see that the "CDropdownField" (which derives from CField) is lost in the stored data.

Subsequently that means when submitting the data back the Array does not contain the proper types. The resulting XML is this:

<customFieldList SOAP-ENC:arrayType="ns1:CField[1]" xsi:type="ns1:ArrayOfCField"><item xsi:type="ns1:CField"><recordid xsi:type="xsd:long">363</recordid><name xsi:type="xsd:string">Customer</name></item></customFieldList>

Note that the first item is simply of type "CField" rather than "CDropdownField". Needless to say this causes the server to reject the request.

Related Bugs: 36575

Reproduce code:
---------------
In the TestTrack API this is simply:

$defect = $soap->editDefect( $cookie, $number, '', false );
$soap->saveDefect( $cookie, $defect );

Docs for the WSDL/API:
http://labs.seapine.com/SDKRequests.php


Expected result:
----------------
The stored data and the returned data should retain the knowledge of the derived types.  In this case the item in the array should be marked as a CDropdownField.

It should be noted that if the data obtained is manually patched, then the return works. That is, setting the "customFieldList" such as:
'customFieldList' => array (
	new SoapVar( array(
		'recordid' => 363,
		'name' => 'Customer',
		'value' => 'Argos (C1407)',
		), XSD_ANYTYPE, 'CDropdownField', 'urn:testtrack-interface' ))



Patches

Add a Patch

Pull Requests

Add a Pull Request

History

AllCommentsChangesGit/SVN commitsRelated reports
 [2010-06-20 21:32 UTC] felipe@php.net
-Status: Open +Status: Feedback
 [2010-06-20 21:32 UTC] felipe@php.net
Please try using this snapshot:

  http://snaps.php.net/php5.2-latest.tar.gz
 
For Windows:

  http://windows.php.net/snapshots/


 [2013-02-18 00:33 UTC] php-bugs at lists dot php dot net
No feedback was provided. The bug is being suspended because
we assume that you are no longer experiencing the problem.
If this is not the case and you are able to provide the
information that was requested earlier, please do so and
change the status of the bug back to "Open". Thank you.
 
PHP Copyright © 2001-2024 The PHP Group
All rights reserved.
Last updated: Thu Apr 18 13:01:27 2024 UTC