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:16
Avg. Score:4.9 ± 0.3
Reproduced:15 of 16 (93.8%)
Same Version:3 (20.0%)
Same OS:4 (26.7%)
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
Welcome back! If you're the original bug submitter, here's where you can edit the bug or add additional notes.
If this is not your bug, you can add a comment by following this link.
If this is your bug, but you forgot your password, you can retrieve your password here.
Password:
Status:
Package:
Bug Type:
Summary:
From: sjoerd-php at linuxonly dot nl
New email:
PHP Version: OS:

 

 [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

Add a Patch

Pull Requests

Add a Pull Request

 
PHP Copyright © 2001-2019 The PHP Group
All rights reserved.
Last updated: Sat Nov 16 22:01:35 2019 UTC