/**
  * Run generator
  */
 public function run()
 {
     $soapClient = new \Soapclient($this->_wsdlPath, array('trace' => true));
     $soapFunctions = $soapClient->__getFunctions();
     $requestFunctionDefinitions = array();
     foreach ($soapFunctions as $soapFunctionDescription) {
         $thisDefinition = array();
         $functionDefinition = '';
         $parts = explode(' ', $soapFunctionDescription);
         $functionDefinition = 'public function get' . ucfirst(substr($parts[1], 0, stripos($parts[1], '(')) . 'Reply');
         $thisDefinition['soapFunction'] = substr($parts[1], 0, stripos($parts[1], '('));
         $requestObjectName = substr($parts[1], stripos($parts[1], '(') + 1);
         $thisDefinition['requestObjectName'] = $requestObjectName;
         $arg1Type = 'ComplexType\\' . $requestObjectName;
         $arg1VariableName = '$' . lcfirst($requestObjectName);
         $thisDefinition['arg1VariableName'] = $arg1VariableName;
         $functionDefinition .= "({$arg1Type} {$arg1VariableName})";
         $thisDefinition['functionDefinition'] = $functionDefinition;
         $requestFunctionDefinitions[] = $thisDefinition;
     }
     echo "Writing file: {$this->_pathToRequestClassFile}\n";
     $fh = fopen($this->_pathToRequestClassFile, 'w');
     $fileBody = $this->_getGeneratedFileBody($requestFunctionDefinitions);
     fwrite($fh, $fileBody);
     fclose($fh);
 }
Example #2
0
 /**
  * Get the functions for this Soap_Client
  *
  * @access public
  * @return string
  */
 public function get_functions()
 {
     if ($this->soapclient == null) {
         throw new Exception('Unknown Soap_Client');
     }
     return $this->soapclient->__getfunctions();
 }
Example #3
0
 /**
  * Make an API call.
  *
  * @param Vraag $vraag
  *
  * @return array
  */
 protected function call(Vraag $vraag)
 {
     $antwoord = $this->client->VraagEnAntwoord($vraag);
     return simplexml_load_string($antwoord->any);
 }