Skip to content
This repository has been archived by the owner on Jun 19, 2019. It is now read-only.

Commit

Permalink
[RELEASE] new release
Browse files Browse the repository at this point in the history
[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 :
http://phpdoc.WsdlToPhp.com/.
For even more informations, also read the main php doc block located in
the WsdlToPhpGenerator class file to see all features and tested cases.
  • Loading branch information
DELSOL Mikaël committed Jan 2, 2013
1 parent b9b13e0 commit 1f5a69d
Show file tree
Hide file tree
Showing 12 changed files with 4,623 additions and 18 deletions.
29 changes: 16 additions & 13 deletions WsdlClassFileTpl.php
Original file line number Original file line Diff line number Diff line change
@@ -1,11 +1,13 @@
<?php <?php
/** /**
* File for PackageNameWsdlClass to communicate with SOAP service * File for PackageNameWsdlClass to communicate with SOAP service
* @package PackageName
* @date generation_date * @date generation_date
*/ */
/** /**
* File for PackageNameWsdlClass to communicate with SOAP service * File for PackageNameWsdlClass to communicate with SOAP service
* meta_informations * meta_informations
* @package PackageName
* @date generation_date * @date generation_date
*/ */
class PackageNameWsdlClass extends stdClass implements ArrayAccess,Iterator,Countable class PackageNameWsdlClass extends stdClass implements ArrayAccess,Iterator,Countable
Expand Down Expand Up @@ -166,6 +168,7 @@ protected static function setSoapClient(SoapClient $_soapClient)
* Method initiating SoapClient * Method initiating SoapClient
* @uses PackageNameWsdlClass::classMap() * @uses PackageNameWsdlClass::classMap()
* @uses PackageNameWsdlClass::getDefaultWsdlOptions() * @uses PackageNameWsdlClass::getDefaultWsdlOptions()
* @uses PackageNameWsdlClass::setSoapClient()
* @param array $_wsdlOptions WSDL options * @param array $_wsdlOptions WSDL options
* @return void * @return void
*/ */
Expand Down Expand Up @@ -318,7 +321,7 @@ public function item($_index)
*/ */
public function add($_item) public function add($_item)
{ {
if($this->getAttributeName() != '' && strpos($this->__toString(),'ArrayOf') !== false) if($this->getAttributeName() != '' && stripos($this->__toString(),'array') !== false)
{ {
/** /**
* init array * init array
Expand All @@ -339,15 +342,15 @@ public function add($_item)
return false; return false;
} }
/** /**
* Method to call when sending data to request for ArrayOf type class * Method to call when sending data to request for *array* type class
* @uses PackageNameWsdlClass::getAttributeName() * @uses PackageNameWsdlClass::getAttributeName()
* @uses PackageNameWsdlClass::__toString() * @uses PackageNameWsdlClass::__toString()
* @uses PackageNameWsdlClass::_get() * @uses PackageNameWsdlClass::_get()
* @return mixed * @return mixed
*/ */
public function toSend() public function toSend()
{ {
if($this->getAttributeName() != '' && strpos($this->__toString(),'ArrayOf') !== false) if($this->getAttributeName() != '' && stripos($this->__toString(),'array') !== false)
return $this->_get($this->getAttributeName()); return $this->_get($this->getAttributeName());
else else
return null; return null;
Expand Down Expand Up @@ -393,7 +396,7 @@ public function offsetGet($_offset)
return $this->offsetExists($_offset)?$this->internArrayToIterate[$_offset]:null; return $this->offsetExists($_offset)?$this->internArrayToIterate[$_offset]:null;
} }
/** /**
* Method useless but necessarly overriden, can't set * Method useless but necessarly overridden, can't set
* @param mixed $_offset * @param mixed $_offset
* @param mixed $_value * @param mixed $_value
* @return null * @return null
Expand All @@ -403,7 +406,7 @@ public function offsetSet($_offset,$_value)
return null; return null;
} }
/** /**
* Method useless but necessarly overriden, can't set * Method useless but necessarly overridden, can't unset
* @param mixed $_offset * @param mixed $_offset
* @return null * @return null
*/ */
Expand All @@ -412,7 +415,7 @@ public function offsetUnset($_offset)
return null; return null;
} }
/** /**
* Method returnint current result from Soap call * Method returning current result from Soap call
* @return mixed * @return mixed
*/ */
public function getResult() public function getResult()
Expand Down Expand Up @@ -467,7 +470,6 @@ public function getLastErrorForMethod($_methoName)
/** /**
* Method returning intern array to iterate trough * Method returning intern array to iterate trough
* @return array * @return array
* @return void
*/ */
public function getInternArrayToIterate() public function getInternArrayToIterate()
{ {
Expand Down Expand Up @@ -498,20 +500,21 @@ public function getInternArrayToIterateOffset()
* @uses PackageNameWsdlClass::getAttributeName() * @uses PackageNameWsdlClass::getAttributeName()
* @uses PackageNameWsdlClass::initInternArrayToIterate() * @uses PackageNameWsdlClass::initInternArrayToIterate()
* @uses PackageNameWsdlClass::__toString() * @uses PackageNameWsdlClass::__toString()
* @param array $_array * @param array the array to iterate trough
* @param bool $_interCall * @param bool indicates that methods is calling itself
* @return void
*/ */
public function initInternArrayToIterate($_array = array(),$_interCall = false) public function initInternArrayToIterate($_array = array(),$_internCall = false)
{ {
if(strpos($this->__toString(),'ArrayOf') !== false) if(stripos($this->__toString(),'array') !== false)
{ {
if(is_array($_array) && count($_array)) if(is_array($_array) && count($_array))
{ {
$this->setInternArrayToIterate($_array); $this->setInternArrayToIterate($_array);
$this->setInternArrayToIterateOffset(0); $this->setInternArrayToIterateOffset(0);
$this->setInternArrayToIterateIsArray(true); $this->setInternArrayToIterateIsArray(true);
} }
elseif(!$_interCall && $this->getAttributeName() != '' && property_exists($this->__toString(),$this->getAttributeName())) elseif(!$_internCall && $this->getAttributeName() != '' && property_exists($this->__toString(),$this->getAttributeName()))
$this->initInternArrayToIterate($this->_get($this->getAttributeName()),true); $this->initInternArrayToIterate($this->_get($this->getAttributeName()),true);
} }
} }
Expand Down Expand Up @@ -572,7 +575,7 @@ public function _get($_name)
return false; return false;
} }
/** /**
* Method returning alone attribute name when class is ArrayOf type * Method returning alone attribute name when class is *array* type
* @return string * @return string
*/ */
public function getAttributeName() public function getAttributeName()
Expand Down
4 changes: 4 additions & 0 deletions WsdlToPhp.php
Original file line number Original file line Diff line number Diff line change
@@ -1,10 +1,14 @@
<?php <?php
/** /**
* File for class WsdlToPhp * File for class WsdlToPhp
* @package WsdlToPhp
* @deprecated In favor to WsdlToPhpGenerator file
* @date 25/06/2012 * @date 25/06/2012
*/ */
/** /**
* Class WsdlToPhp * Class WsdlToPhp
* @package WsdlToPhp
* @deprecated In favor to WsdlToPhpGenerator class
* @date 25/06/2012 * @date 25/06/2012
*/ */
class WsdlToPhp extends SoapClient class WsdlToPhp extends SoapClient
Expand Down
Loading

0 comments on commit 1f5a69d

Please sign in to comment.