/**
  * @see SoapClient::__soapCall
  */
 function __soapCall($function_name, $arguments, $options = null, $input_headers = null, &$output_headers = null)
 {
     $this->GetAdsUser()->updateClientLibraryUserAgent($this->GetAdsUser()->GetUserAgent());
     // Copy the updated user agent to the header of this SOAP client, as it
     // is not copied from AdsUser automatically.
     $this->SetHeaderValue($this->GetAdsUser()->GetUserAgentHeaderName(), $this->GetAdsUser()->GetClientLibraryUserAgent());
     return parent::__soapCall($function_name, $arguments);
 }
 /**
  * Overrides the method __doRequest().  When OAuth authentication is used
  * the URL has OAuth parameters added.
  * @param string $request the request XML
  * @param string $location the URL to request
  * @param string $action the SOAP action
  * @param string $version the SOAP version
  * @param int $one_way if set to 1, this method returns nothing
  * @return string the XML SOAP response
  */
 function __doRequest($request, $location, $action, $version, $one_way = 0)
 {
     $oAuthInfo = $this->user->GetOAuthInfo();
     if ($oAuthInfo != NULL) {
         $oauthParameters = $this->user->GetOAuthHandler()->GetSignedRequestParameters($oAuthInfo, $location, 'POST');
         $location .= '?' . $this->user->GetOAuthHandler()->FormatParametersForUrl($oauthParameters);
     }
     return parent::__doRequest($request, $location, $action, $version);
 }
예제 #3
0
 /**
  * Overrides the method __doRequest(). When OAuth2 authentication is used the
  * URL parameters added.
  * @param string $request the request XML
  * @param string $location the URL to request
  * @param string $action the SOAP action
  * @param string $version the SOAP version
  * @param int $one_way if set to 1, this method returns nothing
  * @return string the XML SOAP response
  */
 function __doRequest($request, $location, $action, $version, $one_way = 0)
 {
     $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);
 }
 /**
  * Overrides the method __doRequest(). When OAuth2 authentication is used the
  * URL parameters added.
  * @param string $request the request XML
  * @param string $location the URL to request
  * @param string $action the SOAP action
  * @param string $version the SOAP version
  * @param int $one_way if set to 1, this method returns nothing
  * @return string the XML SOAP response
  */
 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);
 }
 /**
  * Overrides the method __doRequest().  When OAuth or OAuth2 authentication is
  * used the URL parameters added.
  * @param string $request the request XML
  * @param string $location the URL to request
  * @param string $action the SOAP action
  * @param string $version the SOAP version
  * @param int $one_way if set to 1, this method returns nothing
  * @return string the XML SOAP response
  */
 function __doRequest($request, $location, $action, $version, $one_way = 0)
 {
     $oAuthInfo = $this->user->GetOAuthInfo();
     $oAuth2Info = $this->user->GetOAuth2Info();
     if (isset($oAuthInfo)) {
         $oauthParameters = $this->user->GetOAuthHandler()->GetSignedRequestParameters($oAuthInfo, $location, 'POST');
         $location .= '?' . $this->user->GetOAuthHandler()->FormatParametersForUrl($oauthParameters);
     } elseif (isset($oAuth2Info)) {
         if (!$this->user->IsOAuth2AccessTokenValid() && $this->user->CanRefreshOAuth2AccessToken()) {
             $oAuth2Info = $this->user->RefreshOAuth2AccessToken();
         }
         $oauth2Parameters = $this->user->GetOAuth2Handler()->FormatCredentialsForUrl($oAuth2Info);
         $location .= '?' . $oauth2Parameters;
     }
     return parent::__doRequest($request, $location, $action, $version);
 }
 /**
  * Tests serializing a long field value.
  * @covers AdsSoapClient::TypemapLongToXml
  * @dataProvider TypemapLongToXmlProvider
  */
 public function testTypemapLongToXml($xml, $value, $type)
 {
     $result = AdsSoapClient::TypemapLongToXml($value);
     $this->assertEquals($xml, $result);
 }
예제 #7
0
 /**
  * Constructor for Google's DoubleClick for Publishers API SOAP client.
  * @param string $wsdl URI of the WSDL file or <var>NULL</var> if working in
  *     non-WSDL mode
  * @param array $options the SOAP client options
  * @param AdsUser $user the user which is responsible for this client
  * @param string $serviceName the name of the service which is making this
  *     call
  * @param string $serviceNamespace the namespace of the service
  */
 public function __construct($wsdl, array $options, AdsUser $user, $serviceName, $serviceNamespace)
 {
     parent::__construct($wsdl, $options, $user, $serviceName, $serviceNamespace);
 }
예제 #8
0
 function __soapCall($function_name, $arguments, $options = NULL, $input_headers = NULL, &$output_headers = NULL)
 {
     //echo 'YDirect::__soapCall(), $input_headers = ';
     //var_dump($input_headers);
     return parent::__soapCall($function_name, $arguments, $options, $input_headers, $output_headers);
 }