-
-
Notifications
You must be signed in to change notification settings - Fork 174
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
Number of occurs is ignored for choice #540
Comments
Hi, Thanks for reporting. Nested
This gets flattened to element1 that can only be available once, which is not correct because it should be a max of 15. It even gets more complex:
This means that there is some kind of order possible:
This makes that the maxOccurs are very depending on how many element1's there are. AND given it is a sequence, they should be rendered sequentially. For example:
This brings me to the acutal problem : The wsdl-reader package is flattening those sequences and choices into a simplified representation of the surrounding complexType. In your very specific case, the I'm not really sure on how to continue on this problem to be honest. Any idea's are welcome. In the meantime, you could overwrite those specific types by using https://github.com/phpro/soap-client/blob/v4.x/docs/drivers/metadata.md#type-replacements. Probably by setting: $meta
->withMaxOccurs(-1)
->withIsNullable(false)
->withIsList(true)
->withIsRepeatingElement(true); |
Firstly, thanks for thorough answer. Secondly I created similar xsd and tested behaviour of c# tools. In c#, if occurs is greater then 1, then it's treated in same way as Nevertheless, here is the xsd I tested on:
|
FYI : This PR makes it possible to load information from parent types: However, it turns out that https://github.com/goetas-webservices/xsd-reader skips adding the sequence to its resolved type-tree. This results in reading the schema as:
omitting the Sequence<0,5> We first need to get that fixed before we can optimize how this information is read from the wsdl-reader package. |
This should be fixed once this one gets merged: goetas-webservices/xsd-reader#88 |
Bug Report
Summary
Hello,
when generating classes from WSDL I noticed, that
choice
of complex types were generated as nullable property for each choice but ignoring the number of occurs.Current behavior
Currenty when generating
choice
ofcomplexType
modifersmaxOccurs
andminOccurs
are ignored.How to reproduce
This bug is possible to reproduce on this simple WSDL:
Class
GetCustomerDetailsResponse
should be generated. This class will have nullable property of$Customer
and$CertifiedCustomer
.Expected behavior
Other languages like c# and java genaretes one list with annotatios/attributes however this solution would have impact on other parts like the encoding component. For most of the use-cases mutliple arrays should be sufficient, so that the php class would look like this:
The text was updated successfully, but these errors were encountered: