/** * Perform a generic SOAP method call. * * Depending on boolean $options['async'] it may be: * - synchronous: the operation waits for a response, and result is returned * - asynchronous: the operation is scheduled, but returned immediately * the Request object which may be synchronized by getResult() call later. * * @see SoapClient::__soapCall */ public function __soapCall($functionName, $arguments, $options = array(), $inputHeaders = null, &$outputHeaders = null) { $isAsync = false; if (!empty($options['async'])) { $isAsync = true; unset($options['async']); } $args = func_get_args(); try { // Unfortunately, we cannot use call_user_func_array(), because // it does not support "parent::" construction. And we cannot // call is "statically" because of E_STRICT. parent::__soapCall($functionName, $arguments, $options, $inputHeaders, $outputHeaders); } catch (DelayedException $e) { } $request = new Request($this, $this->_recordedRequest, $args, $this->_clientOptions); $this->_recordedRequest = null; if ($isAsync) { // In async mode - return the request. return $request; } else { // In syncronous mode (default) - wait for a result. return $request->getResult(); } }