php.net |  support |  documentation |  report a bug |  advanced search |  search howto |  statistics |  random bug |  login
Bug #76695 XSD <xs:attributeGroup> AND <xs:extension base="..."> fails
Submitted: 2018-08-02 13:57 UTC Modified: 2018-08-02 21:58 UTC
From: djmaze at cpgnuke dot com Assigned:
Status: Not a bug Package: SOAP related
PHP Version: 7.2.8 OS: Linux
Private report: No CVE-ID: None
View Add Comment Developer Edit
Anyone can comment on a bug. Have a simpler test case? Does it work for you on a different platform? Let us know!
Just going to say 'Me too!'? Don't clutter the database with that please !
Your email address:
MUST BE VALID
Solve the problem:
12 + 42 = ?
Subscribe to this entry?

 
 [2018-08-02 13:57 UTC] 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;
}


Patches

Add a Patch

Pull Requests

Add a Pull Request

History

AllCommentsChangesGit/SVN commitsRelated reports
 [2018-08-02 21:58 UTC] djmaze at cpgnuke dot com
-Status: Open +Status: Closed
 [2018-08-02 21:58 UTC] 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 21:58 UTC] cmb@php.net
-Status: Closed +Status: Not a bug
 
PHP Copyright © 2001-2024 The PHP Group
All rights reserved.
Last updated: Fri Apr 19 18:01:28 2024 UTC