||WSDL To PHP
Generate classes to send SOAP requests from a WSDL
||[UPDATE] PSR-2 standards for generator files and generated files
[UPDATE] enhancement and compliance
In order to let the PHP native SoapClient class handle correctly the
object to send based on the request created with the generated classes,
we no longer define the array to send. Indeed, it's better to let the
SoapClient convert the object passed to the generate method mathcing the
operation to call instead of defining an array based on the object. It
actually creates conflicts or defines values that should be sent.
By this update, the option sendArrayAsParameter should be not useful
By this update we lose the faculty to define a specific behaviour on the
values sent because we previously called the getter associated to the
value to send. In this case, the generate method PHP doc block has been
Update of the sample file to be more explicit on the optional parameter
when instantiating a Service class.
Finally, the sample case for PayPal in samples-generator.php has been
updated to give a functional example based on this update.
[UPDATE] enhancements for duplicated operations
This now generates distinct methods for operations with distinct
parameter type. The generated method matching the operation is named
either with the parameter type (when there is only one parameter) or
with the md5 hash of the var_export value of the parameters.
[UPDATE] enhancements and refactoring
Simplification of the instantiation of Service objects in the
generated sample file by removing the SoapClient options parameter. By
default, the cache_wsdl is disabled, the wsdl_url is set with the WSDL
url used to generate the package and trace is set with true. The
VALUE_WSDL_URL constant has been added to the generated WsdlClass
defined with the WSDL url used to generate the package.
Remove trailing ?> in generator files/classes.
Add WsdlToPhpGenerator::getWsdl($_index) method to get any WSDL at any
Enhance generated sample file with explanation about the optional
parameter allowing to override the SoapClient Options. Remove the $wsdl
parareter previously used to instantiate each Service object.
Avoid Struct object to reset SoapClient when it is instantiated when
calling the parent constructor.
[UPDATE] several updates based on Github updated files
[UPDATE] code review and enhancements
Override WsdlToPhpModel::getOwner() method in inherited classes when it makes sense so the caller knows the exact return type
Enhanced attribute type definition by avoiding that the attribute type is the type of the class it belongs to
[UPDATES] identical operation parameters type naming fix
As the methods, representing the operations, had their parameters named as their type when the parameter type was an existing known class, it generated errors as we had multiple parameters with the same name (ex: login(StructString $_structString,StructString $_structString), which is conflictual). This was used to generate the sample file easily. This issue was fixed by naming the parameters with their real name (when there is multiple parameters) and by reviewing the sample file generation.
||1 year ago