AdWordsSoapClient::__doRequest PHP Méthode

__doRequest() public méthode

See also: SoapClient::__doRequest
public __doRequest ( $request, $location, $action, $version, $one_way )
    function __doRequest($request, $location, $action, $version, $one_way = 0)
    {
        // PHP version < 5.3.3 does not properly append HTTP headers to requests.
        if (version_compare(PHP_VERSION, '5.3.3', '<')) {
            $oAuth2Info = $this->user->GetOAuth2Info();
            $oAuth2Handler = $this->user->GetOAuth2Handler();
            if (!empty($oAuth2Info)) {
                $oAuth2Info = $oAuth2Handler->GetOrRefreshAccessToken($oAuth2Info);
                $this->user->SetOAuth2Info($oAuth2Info);
                $oauth2Parameters = $oAuth2Handler->FormatCredentialsForUrl($oAuth2Info);
                $location .= '?' . $oauth2Parameters;
            }
        }
        return parent::__doRequest($request, $location, $action, $version);
    }

Usage Example

 public function __doRequest($request, $location = NULL, $action = NULL, $version = NULL, $one_way = 0)
 {
     if (!$location) {
         $location = $this->location;
     }
     if (!$version) {
         $version = $this->_soap_version;
     }
     return parent::__doRequest($request, $location, $action, $version, $one_way);
 }