Bug #76695 [NEW]: XSD <xs:attributeGroup> AND <xs:extension base="..."> fails
| From: | djmaze at cpgnuke dot com | Date: | Thu, 02 Aug 2018 13:57:25 +0000 |
| Subject: | Bug #76695 [NEW]: XSD <xs:attributeGroup> AND <xs:extension base="..."> fails | ||
| Groups: | php.bugs | ||
| Request: | Send a blank email to php-bugs+get-216540@lists.php.net to get a copy of this message | ||
From: djmaze at cpgnuke dot com
Operating system: Linux
PHP version: 7.2.8
Package: SOAP related
Bug Type: Bug
Bug description:XSD <xs:attributeGroup> AND <xs:extension base="..."> fails
Description:
------------
When using a WSDL with the OTA XML XSD's something goes very wrong.
The problem is that structures are not extended with <xs:attributeGroup>
and <xs:extension base="*">
This results in incomplete malformed XML when using SoapVar
It is a very large base with many XSD's so i try it with some short code
sample below.
Here the problem is with: RequestorID
All required XSD's are here:
opentravelmodel.net/pubs/specifications/OnlinePublications.html
If needed, i could wrap up a full example with all required sources.
Test script:
---------------
<xs:attributeGroup name="UniqueID_Group">
<xs:attribute name="URL" type="xs:anyURI" use="optional"/>
<xs:attribute name="Type" type="OTA_CodeType" use="required"/>
<xs:attribute name="Instance" type="StringLength1to32"
use="optional"/>
<xs:attribute name="ID" type="StringLength1to32"
use="required"/>
<xs:attribute name="ID_Context" type="StringLength1to32"
use="optional"/>
</xs:attributeGroup>
<xs:complexType name="UniqueID_Type">
<xs:sequence>
<xs:element name="CompanyName" type="CompanyNameType"
minOccurs="0"/>
<xs:element ref="TPA_Extensions" minOccurs="0"/>
</xs:sequence>
<xs:attributeGroup ref="UniqueID_Group"/>
</xs:complexType>
<xs:complexType name="SourceType">
<xs:sequence>
<xs:element name="RequestorID" minOccurs="0">
<xs:complexType>
<xs:complexContent>
<xs:extension base="UniqueID_Type">
<xs:attribute name="MessagePassword" type="StringLength1to16"
use="optional"/>
<xs:attribute name="Name" type="StringLength1to64"
use="optional"/>
</xs:extension>
</xs:complexContent>
</xs:complexType>
</xs:element>
</xs:sequence>
</xs:complexType>
<xs:complexType name="BookingReferenceType">
<xs:sequence>
<xs:element name="UniqueID_Type">
<xs:complexType>
<xs:simpleContent>
<xs:extension base="Enum_UniqueIDType">
<xs:attribute name="extension" type="xs:string"
use="optional"/>
<xs:attribute name="ID_Context" type="StringLength1to32"
use="optional"/>
<xs:attribute name="URL" type="xs:anyURI" use="optional"/>
</xs:extension>
</xs:simpleContent>
</xs:complexType>
</xs:element>
</xs:sequence>
</xs:complexType>
Expected result:
----------------
print_r(SoapClient::__getTypes())
[86] => string StringLength1to16
[90] => string StringLength1to64
[664] => struct SourceType {
RequestorID RequestorID;
}
[665] => struct RequestorID {
anyType CompanyName
anyType TPA_Extensions
anyURI URL
OTA_CodeType Type
StringLength1to32 Instance
StringLength1to32 ID
StringLength1to32 ID_Context
StringLength1to16 MessagePassword;
StringLength1to64 Name;
}
[691] => struct UniqueID_Type {
anyType CompanyName;
anyType TPA_Extensions;
anyURI URL
OTA_CodeType Type
StringLength1to32 Instance
StringLength1to32 ID
StringLength1to32 ID_Context
StringLength1to16 MessagePassword;
StringLength1to64 Name;
}
[859] => struct UniqueID_Type {
string extension;
StringLength1to32 ID_Context;
anyURI URL;
}
Actual result:
--------------
print_r(SoapClient::__getTypes())
[664] => struct SourceType {
RequestorID RequestorID;
}
[665] => struct RequestorID {
UNKNOWN MessagePassword;
UNKNOWN Name;
}
[691] => struct UniqueID_Type {
anyType CompanyName;
anyType TPA_Extensions;
}
//<xs:element name="UniqueID_Type">
[859] => struct UniqueID_Type {
string extension;
UNKNOWN ID_Context;
anyURI URL;
}
--
Edit bug report at https://bugs.php.net/bug.php?id=76695&edit=1
--
Try a snapshot (PHP 5.4): https://bugs.php.net/fix.php?id=76695&r=trysnapshot54
Try a snapshot (PHP 5.5): https://bugs.php.net/fix.php?id=76695&r=trysnapshot55
Try a snapshot (trunk): https://bugs.php.net/fix.php?id=76695&r=trysnapshottrunk
Fixed in SVN: https://bugs.php.net/fix.php?id=76695&r=fixed
Fixed in release: https://bugs.php.net/fix.php?id=76695&r=alreadyfixed
Need backtrace: https://bugs.php.net/fix.php?id=76695&r=needtrace
Need Reproduce Script: https://bugs.php.net/fix.php?id=76695&r=needscript
Try newer version: https://bugs.php.net/fix.php?id=76695&r=oldversion
Not developer issue: https://bugs.php.net/fix.php?id=76695&r=support
Expected behavior: https://bugs.php.net/fix.php?id=76695&r=notwrong
Not enough info: https://bugs.php.net/fix.php?id=76695&r=notenoughinfo
Submitted twice: https://bugs.php.net/fix.php?id=76695&r=submittedtwice
register_globals: https://bugs.php.net/fix.php?id=76695&r=globals
PHP 4 support discontinued: https://bugs.php.net/fix.php?id=76695&r=php4
Daylight Savings: https://bugs.php.net/fix.php?id=76695&r=dst
IIS Stability: https://bugs.php.net/fix.php?id=76695&r=isapi
Install GNU Sed: https://bugs.php.net/fix.php?id=76695&r=gnused
Floating point limitations: https://bugs.php.net/fix.php?id=76695&r=float
No Zend Extensions: https://bugs.php.net/fix.php?id=76695&r=nozend
MySQL Configuration Error: https://bugs.php.net/fix.php?id=76695&r=mysqlcfg