Permalink
Browse files

[RELEASE] new release

[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...
mikaelcom committed Jan 2, 2013
1 parent b9b13e0 commit 1f5a69d24e64512d677c1ffcdcfca6fcb6b17155
Showing with 4,623 additions and 18 deletions.
  1. +16 −13 WsdlClassFileTpl.php
  2. +4 −0 WsdlToPhp.php
  3. +291 −0 WsdlToPhpFunction.php
  4. +2,285 −0 WsdlToPhpGenerator.php
  5. +506 −0 WsdlToPhpModel.php
  6. +154 −0 WsdlToPhpService.php
  7. +497 −0 WsdlToPhpStruct.php
  8. +306 −0 WsdlToPhpStructAttribute.php
  9. +108 −0 WsdlToPhpStructValue.php
  10. +2 −0 sample-tpl.php
  11. +143 −0 samples-generator.php
  12. +311 −5 samples.php
@@ -1,11 +1,13 @@
<?php
/**
* File for PackageNameWsdlClass to communicate with SOAP service
* @package PackageName
* @date generation_date
*/
/**
* File for PackageNameWsdlClass to communicate with SOAP service
* meta_informations
* @package PackageName
* @date generation_date
*/
class PackageNameWsdlClass extends stdClass implements ArrayAccess,Iterator,Countable
@@ -166,6 +168,7 @@ protected static function setSoapClient(SoapClient $_soapClient)
* Method initiating SoapClient
* @uses PackageNameWsdlClass::classMap()
* @uses PackageNameWsdlClass::getDefaultWsdlOptions()
* @uses PackageNameWsdlClass::setSoapClient()
* @param array $_wsdlOptions WSDL options
* @return void
*/
@@ -318,7 +321,7 @@ public function item($_index)
*/
public function add($_item)
{
if($this->getAttributeName() != '' && strpos($this->__toString(),'ArrayOf') !== false)
if($this->getAttributeName() != '' && stripos($this->__toString(),'array') !== false)
{
/**
* init array
@@ -339,15 +342,15 @@ public function add($_item)
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::__toString()
* @uses PackageNameWsdlClass::_get()
* @return mixed
*/
public function toSend()
{
if($this->getAttributeName() != '' && strpos($this->__toString(),'ArrayOf') !== false)
if($this->getAttributeName() != '' && stripos($this->__toString(),'array') !== false)
return $this->_get($this->getAttributeName());
else
return null;
@@ -393,7 +396,7 @@ public function offsetGet($_offset)
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 $_value
* @return null
@@ -403,7 +406,7 @@ public function offsetSet($_offset,$_value)
return null;
}
/**
* Method useless but necessarly overriden, can't set
* Method useless but necessarly overridden, can't unset
* @param mixed $_offset
* @return null
*/
@@ -412,7 +415,7 @@ public function offsetUnset($_offset)
return null;
}
/**
* Method returnint current result from Soap call
* Method returning current result from Soap call
* @return mixed
*/
public function getResult()
@@ -467,7 +470,6 @@ public function getLastErrorForMethod($_methoName)
/**
* Method returning intern array to iterate trough
* @return array
* @return void
*/
public function getInternArrayToIterate()
{
@@ -498,20 +500,21 @@ public function getInternArrayToIterateOffset()
* @uses PackageNameWsdlClass::getAttributeName()
* @uses PackageNameWsdlClass::initInternArrayToIterate()
* @uses PackageNameWsdlClass::__toString()
* @param array $_array
* @param bool $_interCall
* @param array the array to iterate trough
* @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))
{
$this->setInternArrayToIterate($_array);
$this->setInternArrayToIterateOffset(0);
$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);
}
}
@@ -572,7 +575,7 @@ public function _get($_name)
return false;
}
/**
* Method returning alone attribute name when class is ArrayOf type
* Method returning alone attribute name when class is *array* type
* @return string
*/
public function getAttributeName()
@@ -1,10 +1,14 @@
<?php
/**
* File for class WsdlToPhp
* @package WsdlToPhp
* @deprecated In favor to WsdlToPhpGenerator file
* @date 25/06/2012
*/
/**
* Class WsdlToPhp
* @package WsdlToPhp
* @deprecated In favor to WsdlToPhpGenerator class
* @date 25/06/2012
*/
class WsdlToPhp extends SoapClient
Oops, something went wrong.

0 comments on commit 1f5a69d

Please sign in to comment.