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:2
Avg. Score:5.0 ± 0.0
Reproduced:2 of 2 (100.0%)
Same Version:2 (100.0%)
Same OS:2 (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
View Add Comment Developer Edit
Welcome! If you don't have a Git account, you can't do anything here.
You can add a comment by following this link or if you reported this bug, you can edit this bug over here.
(description)
Block user comment
Status: Assign to:
Package:
Bug Type:
Summary:
From: jpleveille at gmail dot com
New email:
PHP Version: OS:

 

 [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-2020 The PHP Group
All rights reserved.
Last updated: Wed Feb 19 13:01:30 2020 UTC