-
-
Notifications
You must be signed in to change notification settings - Fork 176
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
The generated class does not correspond to reality #496
Comments
Thanks for reporting! It's nice to get some real-world feedback from you, pointing out some of the pitfalls of the new wsdl-based type system. This seems to be a bug in the new WSDL reader package: I'll try to get to it soon. |
Can you retry with the latest version of wsdl-reader? It should now generate code following the structure below.
|
The generated classes looks like better. Could you set up nullable property by default private ?\App\ChannelManager\ImmobiNet\Soap\Agenzia\Type\ImmobileVilla $villa; but API return nothing and i get exception with
I haven't a choice, how check property before access. I image like private ?\App\ChannelManager\ImmobiNet\Soap\Agenzia\Type\ImmobileVilla $villa = null; |
Yes, that's possible: $assembler = new PropertyAssembler(
PropertyAssemblerOptions::create()->withOptionalValue()
); Example: soap-client/test/PhproTest/SoapClient/Unit/CodeGenerator/Assembler/PropertyAssemblerTest.php Lines 64 to 88 in 60a6631
Note: You probably want to combine this with the optional getter as well for type-safety: $assembler = new GetterAssembler(GetterAssemblerOptions::create()->withOptionalValue()); Example: soap-client/test/PhproTest/SoapClient/Unit/CodeGenerator/Assembler/GetterAssemblerTest.php Lines 75 to 94 in 60a6631
|
Thank you, very much, it works. I think, this behavior could be enabled by default. |
No prob :)
I've considered it when implementing and don't think this is a good idea for several reasons: This library follows the provided schema in the WSDL, so if it says it's a For example: it could make sense for wither-based requests but not for constructor based requests. Also for models that are being used as response DTOs it would be incorrect. Instead, I've given to option for you to generate the code in the way you want. Just not by default. |
@veewee |
The case you mention should just work. |
Bug Report
Summary
Hello, I use WSDL. I try to call method getImmobili. Where is
getImmobiliResponse->immobili->immobile
described. The gerated class looks like:And returned object looks like
The result is, I can't access to properties. The previous version 2.4.2 was generate all methods and has bug with property name #477.
Generated class with version 2.4.2
The text was updated successfully, but these errors were encountered: