Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

OTA – ListOfRPHType not found #71

Closed
tpraxl opened this issue Nov 6, 2018 · 7 comments · Fixed by #96
Closed

OTA – ListOfRPHType not found #71

tpraxl opened this issue Nov 6, 2018 · 7 comments · Fixed by #96
Labels

Comments

@tpraxl
Copy link

tpraxl commented Nov 6, 2018

I'm using xsd2php to generate classes for OTA 2003/05 / 2014A-1.0.

Until now, everything went fine. However, there's an issue with a simpleType that is not generated. I tried to alias the type without success.

Class 'Hsp\latest\ListOfRPHType' not found in […]generated/v2014A-1-0/src/ResGuestRPHsType.php on line 11

My configuration:

# see https://github.com/goetas-webservices/xsd2php
xsd2php:
  namespaces:
    '': 'Hsp\latest'
    'http://www.opentravel.org/OTA/2003/05': 'Hsp\latest'
    'http://www.opentravel.org/OTA/2003/05/common': 'Hsp\latest'
  destinations_php:
    'Hsp\latest': generated/v2014A-1-0/src
  destinations_jms:
    'Hsp\latest': generated/v2014A-1-0/meta

And here's the generated code that causes the problem:

<?php

namespace Hsp\latest;

/**
 * Class representing ResGuestRPHsType
 *
 * A collection of unsigned integers serving as reference placeholders, and used as an index identifying which guests occupy this room
 * XSD Type: ResGuestRPHsType
 */
class ResGuestRPHsType extends ListOfRPHType
{


}

ListOfRPH is an xs:simpleType in OTA_SimpleTypes.xsd. ListOfRPHType is not generated and I can't find a way to prevent xsd2php from referencing it.

Can anyone help me with a workaround or solution?

@goetas
Copy link
Member

goetas commented Nov 6, 2018

Hmm. list types are particular... are you using the latest version of this lib ?

can you check if ListOfRPHType is a simple type or complex in the XSD?

@tpraxl
Copy link
Author

tpraxl commented Nov 6, 2018

@goetas

I'm using "goetas-webservices/xsd2php-runtime": "^0.2.8" and "goetas-webservices/xsd2php": "^0.3.3".

It should be a simple type:

OTA_SimpleTypes:

<xs:simpleType name="ListOfRPH">
  <xs:annotation>
     <xs:documentation xml:lang="en">List of Reference Place Holders.</xs:documentation>
  </xs:annotation>
  <xs:list itemType="RPH_Type"/>
</xs:simpleType>

OTA_HotelReservation.xsd:

<xs:complexType name="ResGuestRPHsType">
  <xs:annotation>
    <xs:documentation xml:lang="en">A collection of unsigned integers serving as reference placeholders, and used as an index identifying which guests occupy this room</xs:documentation>
  </xs:annotation>
  <xs:simpleContent>
	<xs:extension base="ListOfRPH"/>
  </xs:simpleContent>
</xs:complexType>

@goetas
Copy link
Member

goetas commented Nov 6, 2018

Something related to

if ($type instanceof SimpleType) {
and to list detection in simple types

@tpraxl
Copy link
Author

tpraxl commented Nov 6, 2018

I didn't understand, what you tried to tell me in your latest comment.

I'm not really interested in the type ListOfRPH or ResGuestRPHsType.
Can you think of an easy way to get rid of it or to work around the problem?

@goetas
Copy link
Member

goetas commented Nov 6, 2018

I'm not really interested in the type ListOfRPH or ResGuestRPHsType.
Can you think of an easy way to get rid of it or to work around the problem?

the bug seems to be in that line and on the reason why ResGuestRPHsType is not converted to an array of strings... as it should be

@op-mawi
Copy link

op-mawi commented Jan 21, 2019

Is there any solution or fix for this problem?

I've got the same issue with a list of float values.

    <xs:simpleType name="float">
        <xs:restriction base="xs:float"/>
    </xs:simpleType>

    <xs:simpleType name="FloatList">
        <xs:list itemType="float"/>
    </xs:simpleType>

    <xs:simpleType name="XYPair">
        <xs:restriction base="FloatList"/>
    </xs:simpleType>

It will be serialized as FloatListType in the JMS metadata and as XYPair in the generated PHP classes.
But none of this PHP classes will be generated, so it will cause a "Class XYPair not found" exception.

I think an array of float values will be correct here or a class with an array as property or what ever.

@goetas
Copy link
Member

goetas commented Sep 4, 2019

The resolution of this bug has been sponsored by https://www.weekend4two.com/ and their team. Thanks again for supporting open source and this project.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Projects
None yet
Development

Successfully merging a pull request may close this issue.

3 participants