php.net |  support |  documentation |  report a bug |  advanced search |  search howto |  statistics |  random bug |  login
Bug #48570 SubstitutionGroup in XML schema not supported
Submitted: 2009-06-16 18:40 UTC Modified: -
Votes:17
Avg. Score:4.9 ± 0.3
Reproduced:16 of 17 (94.1%)
Same Version:3 (18.8%)
Same OS:4 (25.0%)
From: sjoerd-php at linuxonly dot nl Assigned:
Status: Open Package: SOAP related
PHP Version: 5.2.9 OS: Linux 2.6.28 Ubuntu 9.0.4
Private report: No CVE-ID: None
 [2009-06-16 18:40 UTC] sjoerd-php at linuxonly dot nl
Description:
------------
Elements in a XML schema (XSD) may have a substitutionGroup attribute which indicates that this element may be used instead of an other element. When an element with a substitutionGroup is defined in the schema part of the WSDL and the endpoint returns a substitution instead of the original element, the SoapClient does not deserialize the XML and returns nothing. 

Reproduce code:
---------------
Part of WSDL:
<xsd:element name="originalElement" type="xsd:string" />
<xsd:element name="substitutionElement" substitutionGroup="tns:originalElement" type="xsd:string" />

MySoapMethod returns a originalElement.

Returned XML:
<?xml version='1.0' encoding='utf-8'?>
<soapenv:Envelope xmlns:soapenv="http://schemas.xmlsoap.org/soap/envelope/">
<soapenv:Body>
<!-- Instead of originalElement, we return substitutionElement. It should make no difference. -->
<substitutionElement>bla</substitutionElement>
</soapenv:Body>
</soapenv:Envelope>

In PHP, call method and expect "bla" to be returned:
echo $client->MySoapMethod();

Expected result:
----------------
Because in the example substitutionElement can be used instead of originalElement, I expect the contents of substitutionElement to be returned if there is no originalElement.

Actual result:
--------------
An empty string is returned, if there is no originalElement.

Patches

Pull Requests

 
PHP Copyright © 2001-2024 The PHP Group
All rights reserved.
Last updated: Sun Dec 08 20:01:27 2024 UTC