/** * Overrides the method SoapClient.__soapCall() to process the * response from the SOAP call. * @param string $function_name the name of the function being called * @param array $arguments the arguments to that function * @param array $options the options for the SOAP call * @param array $input_headers the optional input headers * @param array $output_headers the options output headers * @return mixed the return from the parent __soapCall * @throws SOAPFault if there was an exception making the request */ function __soapCall($function_name, $arguments, $options = NULL, $input_headers = NULL, &$output_headers = NULL) { DeprecationUtils::CheckUsingClientLogin($this->user); try { $input_headers[] = $this->GenerateSoapHeader(); $this->lastHeaders = $input_headers; $this->lastArguments = $arguments; $response = parent::__soapCall($function_name, $arguments, $options, $input_headers, $output_headers); $this->ProcessResponse($this->lastRequest, $this->__getLastResponse(), $function_name); return $response; } catch (SoapFault $e) { $this->ProcessResponse($this->lastRequest, $this->__getLastResponse(), $function_name, $e); throw $e; } }
/** * Overrides the method SoapClient.__soapCall() to process the * response from the SOAP call. * @param string $function_name the name of the function being called * @param array $arguments the arguments to that function * @param array $options the options for the SOAP call * @param array $input_headers the optional input headers * @param array $output_headers the options output headers * @return mixed the return from the parent __soapCall * @throws SOAPFault if there was an exception making the request */ function __soapCall($function_name, $arguments, $options = NULL, $input_headers = NULL, &$output_headers = NULL) { DeprecationUtils::CheckUsingClientLogin($this->user); try { $input_headers[] = $this->GenerateSoapHeader(); $this->lastHeaders = $input_headers; $this->lastArguments = $arguments; $httpHeaders = $this->GenerateHttpHeaders(); if (!empty($httpHeaders)) { // The context this soap client was originally created with. This is the // only way to modify the HTTP headers per soap call. $existingStreamContext = $this->options['stream_context']; $existingStreamContextOptions = stream_context_get_options($existingStreamContext); // Override the existing HTTP headers each time since they may have // changed. $existingStreamContextOptions['http']['header'] = implode("\r\n", array_map('AdsSoapClient::implodeHttpHeaders', array_keys($httpHeaders), $httpHeaders)); stream_context_set_option($existingStreamContext, $existingStreamContextOptions); } $response = parent::__soapCall($function_name, $arguments, $options, $input_headers, $output_headers); $this->ProcessResponse($this->lastRequest, $this->__getLastResponse(), $function_name); return $response; } catch (SoapFault $e) { $this->ProcessResponse($this->lastRequest, $this->__getLastResponse(), $function_name, $e); throw $e; } }