Tutorial Extension  1.0.0
SellerDeck Extensions - Tutorial Extension
Public Member Functions | Public Attributes | List of all members
CSDApiSoapClient Class Reference

Public Member Functions

 __construct ($oSoapClient=null, $bSoapCallLoop=false)
 
 __call ($sFuncName, $aArguments)
 

Public Attributes

const MAX_WAIT = 100
 

Detailed Description

Definition at line 14 of file CSDApiSoapClient.php.

Constructor & Destructor Documentation

__construct (   $oSoapClient = null,
  $bSoapCallLoop = false 
)

__construct - Object constructor method

Initializes the member variables

public

Parameters
SoapClient$oSoapClientSoap Client Object
bool$bSoapCallLoopDo we use retry loop or not when a Soap Call fails?
Returns
void

Definition at line 42 of file CSDApiSoapClient.php.

43  {
44  $this->m_oSoapClient = $oSoapClient;
45  $this->m_bSoapCallLoop = $bSoapCallLoop;
46  }

Member Function Documentation

__call (   $sFuncName,
  $aArguments 
)

__call - Soap Function caller (PHP Magic Method)

public

Parameters
string$sFuncNameSoap Function name
array$aArgumentsSoap Function arguments
Returns
int Error code
mixed Soap Function call result

Definition at line 57 of file CSDApiSoapClient.php.

58  {
59  //
60  // Do we use retry loop or not when a Soap Call fails?
61  //
62  if ($this->m_bSoapCallLoop)
63  {
64  //
65  // The Result variable is null by default
66  //
67  $nResult = null;
68  //
69  // Loop counter
70  //
71  $iCount = 0;
72  do
73  {
74  //
75  // Sleep time is increasing by each loop
76  // * 1000 means we ccount in milliseconds, not microseconds
77  //
78  usleep($iCount * 1000);
79  $iCount++;
80  //
81  // Calling Soap Function
82  //
83  $nResult = $this->m_oSoapClient->__call($sFuncName, $aArguments);
84  }
85  //
86  // Do that, while there's an error...
87  //
88  while ($nResult instanceof SoapFault && $iCount < self::MAX_WAIT);
89  //
90  // Returns the Function result or error, if there were errors MAX_WAIT times
91  //
92  return $nResult;
93  }
94  else
95  {
96  //
97  // Returns the Function result or error
98  //
99  return $this->m_oSoapClient->__call($sFuncName, $aArguments);
100  }
101  }

Member Data Documentation

const MAX_WAIT = 100

int Maximum number of retry loops when a Soap Call fails

Definition at line 20 of file CSDApiSoapClient.php.


The documentation for this class was generated from the following file: