PHP Classes

File: WsdlClassFileTpl.php

Recommend this page to a friend!
  Classes of WsdlToPhp   WSDL To PHP   WsdlClassFileTpl.php  
File: WsdlClassFileTpl.php
Role: Class source
Content type: text/plain
Description: Class source
Class: WSDL To PHP
Generate classes to send SOAP requests from a WSDL
Author: By
Last change: [UPDATE] minor PHP doc block updates
[UPDATE] missing SoapClient options, SoapClient overriding
Missing SoapClient options have been added.

Now we can override easily the SoapClient class that is used by the
WsdlClass. Refer to the new method WsdlClass::getSoapClientClassName()
to learn how it works. Basically, the overridding class must override
the native PHP SoapClien class and it must be named as:
[UPDATE] PSR-2 standards for generator files and generated files
[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] constants
add WSDL_PASSWORD and WSDL_EXCEPTIONS constant and make WSDL_PASSWD and WSDL_EXCPTS constants deprecated
[UPDATE] minor update
[UPDATE] improvements

Use isset() function to determine if __default_soap_headers and _stream_context are already defined instead of using @ when getting the the SoapClient properties
[UPDATE] ease cases for returned or sent array values
[UPDATE] minor update to fix convertStringHeadersToArray() method
[UPDATE] minor update to improve __set_state
[UPDATE] minor php doc updates
[UPDATE] adding several methods to manipulate headers

Adding methods to get Soap headers (getLastRequestHeaders and getLastResponseHeaders) in order to get headers even as string or an associative array.

Adding a method to ease the setting of HTTP Headers (setHttpHeader) in the Soap object stream context
[UPDATE] SoapHeader improvements

After one case that breaks, we discover one little bug when catching data for SoapHeaders from schemas. Indeed, the namespace was wrong and the name of the parameter too. We made sure data are retrieved from the right WSDL attributes and that each SoapHeader is well defined in the Service class.

Put setSoapHeader method in the *WsdlClass so each Service class can call it which simplifies its definition
[UPDATE] updates initiated by the pull request
[UPDATE] minor fix and improvements

Fix generic WsdlClass::__set_state() method in order to instantiate dynamically the object without any parameters.

Improve "from schema" meta storage by providing the constant WsdlToPhpModel::META_FROM_SCHEMA and two methods WsdlToPhpModel::setFromSchema() and WsdlToPhpModel::getFromSchema(). These two methods are then used within WsdlToPhpGenerator methods to store this information.
[UPDATE] minor updates: date format and php doc block
[UPDATE] adding __set_state() method and enhancements

Add generic WsdlClass::__set_state() method in order to allow var_export() result to be used. This method is also added to each generated Struct class.

Ensure that PHP reserved methods are not overridden in WsdlToPhpModel
[UPDATE] bug fix and improvements

Fix generated setSoapHeader method in service classes

Improve WsdlToPhpModel class in order to ensure that none of the WsdlClass methods is overriden by a WSDL operation
[UPDATE] new WsdlClass methods

Adding two methods : getLastRequest and getLastResponse in order to get respectively the last request and the last reponse as a DOMDocument or as a formated XML string
[UPDATE] new features and php doc improvement

WsdlClass__construct method allows to reset or not the SoapClient if its not needed.

New methods are generated within the Services classes in order to set the SoapHeaders after instancitating the service class. For each required SoapHeader, a method is available and makes easy to set the SoapHeader.

Improvement in WsdlToPhpModel::getValueWithinItsType() in order to allow to indicate in wich type the value should be returned

Update Structs __construct() method when WsdlClass is not generated in order to call its setters
[UPDATE] php doc fix
[UPDATE] merge from pull request on github and don't generate structs that don't contain any attribute and don't inherit from generated struct
[RELEASE]This release makes the WsdlToPhp class deprecated which is replaced by the WsdlToPhpGenerator class as for the samples.php file replaced by the samples-generator.php file.
WsdlToPhpGenerator class uses a set of classes which inherits from the new class named WsdlToPhpModel. The classes are :
- WsdlToPhpFunction : an operation
- WsdlToPhpService : a set of operations represented by WsdlToPhpFunction objects
- WsdlToPhpStructAttribute : an attribute of a struct
- WsdlToPhpStructValue : a value of an enumeration struct
- WsdlToPhpStruct : a struct which can be a request object, a response object, an enumeration definition or any useful object defined in the WSDL
- WsdlToPhpModel : defines the generic methods and features of the previous classes
WsdlToPhpGenerator is based on the original WsdlToPhp class but full reviewed in order to use the new classes. This new set of classes make enhancements and bug fixes easier to implement.
Is also fixes some bugs and misunderstandings about the content of the WSDL and its structs.
It now adds good php doc blocks in order to generate php documentation with phpdocumentor. It introduces package, subpackage and has improved general documentation.
Moreover, generated classes are strictly separated by their naming :
- {PackageName}Service* : class which gathers the operations/functions (based on their name)
- {PackageName}Struct* : class which represents a struct type which can be used either for requesting or catching response
- {PackageName}Enum* : class which represents an enumeration of values. Each value is defined with a constant
- {PackageName}WsdlClass : mother class of all generated class if enabled. This class defines all the generic methods and the needed configurations/methods to call the SOAP WS
- {PackageName}ClassMap : class that constains one final public static method which returns the array to map structs/enums to generated classes
You can see the phpdoc about this whole package here :
For even more informations, also read the main php doc block located in the WsdlToPhpGenerator class file to see all features and tested cases.
Date: 9 years ago
Size: 32,467 bytes

You need to be a registered user and login to get this file.

Login Immediately with your account on: