|  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: -
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
Have you experienced this issue?
Rate the importance of this bug to you:

 [2009-06-16 18:40 UTC] sjoerd-php at linuxonly dot nl
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="">
<!-- Instead of originalElement, we return substitutionElement. It should make no difference. -->

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.


Add a Patch

Pull Requests

Add a Pull Request

PHP Copyright © 2001-2024 The PHP Group
All rights reserved.
Last updated: Sun Jul 14 09:01:28 2024 UTC