php.net |  support |  documentation |  report a bug |  advanced search |  search howto |  statistics |  random bug |  login
Bug #78315 Included schemas don't adopt the targetNamespace of includer
Submitted: 2019-07-20 19:36 UTC Modified: -
Votes:3
Avg. Score:5.0 ± 0.0
Reproduced:3 of 3 (100.0%)
Same Version:3 (100.0%)
Same OS:3 (100.0%)
From: jpleveille at gmail dot com Assigned:
Status: Open Package: SOAP related
PHP Version: 7.3.7 OS: Linux
Private report: No CVE-ID: None
Have you experienced this issue?
Rate the importance of this bug to you:

 [2019-07-20 19:36 UTC] jpleveille at gmail dot com
Description:
------------
When a schema includes another schema that doesn't declare a namespace (i.e. no xmlns), the included schema does not adopt the targetNamespace of the includer.

Short script linked below outputs EXPECTED and ACTUAL result. Although both results are returned by a SOAP client, the EXPECTED output is from an XSD altered with the namespace of the includer (which provides the desired effect, yet defeats the purpose).

This impacts the process of marshaling the return value of __soapCall() as content for included types will be missing (as shown in the test script).

Tested on Windows (PHP7.3.7) and Linux (PHP7.3.7 and PHP7.2.19)


Test script:
---------------
https://gist.github.com/webgraphe/d0a665aaad3c827b041eabb9128b62f7

Expected result:
----------------
Running the script from the command line, the output should be:

ACTUAL
TYPES: struct User {
 int Amount;
 string CurrencyCode;
}
RESPONSE: {
    "Amount": 123,
    "CurrencyCode": "USD"
}

EXPECTED
TYPES: struct User {
 int Amount;
 string CurrencyCode;
}
RESPONSE: {
    "Amount": 123,
    "CurrencyCode": "USD"
}


Actual result:
--------------
Running the script from the command line, the output actually is:

ACTUAL
TYPES: struct User {
}
RESPONSE: {}

EXPECTED
TYPES: struct User {
 int Amount;
 string CurrencyCode;
}
RESPONSE: {
    "Amount": 123,
    "CurrencyCode": "USD"
}


Patches

Add a Patch

Pull Requests

Add a Pull Request

 
PHP Copyright © 2001-2024 The PHP Group
All rights reserved.
Last updated: Fri Apr 19 15:01:28 2024 UTC