Bug #76695 [Csd->Nab]: XSD <xs:attributeGroup> AND <xs:extension base="..."> fails
| From: | cmb@php.net | Date: | Thu, 02 Aug 2018 21:58:38 +0000 |
| Subject: | Bug #76695 [Csd->Nab]: XSD <xs:attributeGroup> AND <xs:extension base="..."> fails | ||
| References: | 1 | Groups: | php.bugs |
| Request: | Send a blank email to php-bugs+get-216545@lists.php.net to get a copy of this message | ||
Edit report at https://bugs.php.net/bug.php?id=76695&edit=1
ID: 76695
Updated by: cmb@php.net
Reported by: djmaze at cpgnuke dot com
Summary: XSD <xs:attributeGroup> AND <xs:extension
base="..."> fails
-Status: Closed
+Status: Not a bug
Type: Bug
Package: SOAP related
Operating System: Linux
PHP Version: 7.2.8
Block user comment: N
Private report: N
Previous Comments:
------------------------------------------------------------------------
[2018-08-02 21:58:01] djmaze at cpgnuke dot com
It seems the OTA XML is buggy. Almost all code and examples work when i bugfix the namespace in the
include XSD's
------------------------------------------------------------------------
[2018-08-02 13:57:25] djmaze at cpgnuke dot com
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 this bug report at https://bugs.php.net/bug.php?id=76695&edit=1