|  support |  documentation |  report a bug |  advanced search |  search howto |  statistics |  random bug |  login
Bug #37523 namespaces added too late, leads to missing xsi:type attributes
Submitted: 2006-05-19 16:49 UTC Modified: 2006-05-26 09:09 UTC
Avg. Score:5.0 ± 0.0
Reproduced:3 of 3 (100.0%)
Same Version:3 (100.0%)
Same OS:1 (33.3%)
From: pav at FreeBSD dot org Assigned: dmitry (profile)
Status: Closed Package: SOAP related
PHP Version: 5.1.4 OS: any
Private report: No CVE-ID: None
 [2006-05-19 16:49 UTC] pav at FreeBSD dot org
Changes made in libxml2 between version 2.6.23 and 2.6.24, exactly rev. 1.366 of tree.c, exactly added return(NULL) in xmlSetProp(), cause attributes with unknown namespaces to be silently dropped, instead of added into the document.

PHP SOAP extension, when making a client request, when running in "encoded" mode, is adding xsi:type attributes to nodes (soap.c line 3948). The xmlns:xsi namespace is added later in that function (soap.c line 4073).

Paired with the behaviour of a new libxml2 release, this leads to the xsi:type attribute not being added.

Possible solution is to move if (use == ENCODED) block above the for (i = 0; i < arg_count; i++) block in serialize_function_call() in soap.c.

Reproduce code:
$client = new SoapClient("", array("trace"=>true));

Expected result:
... <ns1:getprofil><profil xsi:type="xsd:decimal">4</profil></ns1:getprofil> ...

Actual result:
... <ns1:getprofil><profil>4</profil></ns1:getprofil> ...


Add a Patch

Pull Requests

Add a Pull Request


AllCommentsChangesGit/SVN commitsRelated reports
 [2006-05-26 09:09 UTC]
Fixed in CVS HEAD and PHP_5_2, but not in PHP_5_1.

PHP Copyright © 2001-2023 The PHP Group
All rights reserved.
Last updated: Wed Feb 08 12:05:49 2023 UTC