Php 函数(“设置OAPHEADERS”)不是此服务的有效方法
您好,我正在尝试使用Google adWords API,刚开始时,我遇到了一个“无效方法”的问题,尽管我正确地遵循了所有操作(我相信),下面是我的代码:Php 函数(“设置OAPHEADERS”)不是此服务的有效方法,php,soap,soap-client,Php,Soap,Soap Client,您好,我正在尝试使用Google adWords API,刚开始时,我遇到了一个“无效方法”的问题,尽管我正确地遵循了所有操作(我相信),下面是我的代码: ini_set("soap.wsdl_cache_enabled",0); class adwords { protected $server = "###"; protected $version = "###"; protected $email = "###"; protected $password
ini_set("soap.wsdl_cache_enabled",0);
class adwords {
protected $server = "###";
protected $version = "###";
protected $email = "###";
protected $password = "###";
protected $auth_key = "###";
protected $dev_key = "###";
protected $ua = "###";
protected $client_id = ###;
public function __construct() {
$this->campaign_service();
}
public function campaign_service() {
$service = "CampaignService";
$options = array(
'encoding' => 'utf-8',
'features' => SOAP_SINGLE_ELEMENT_ARRAYS
);
$wsdl = "{$this->server}/{$this->version}/{$service}?wsdl";
$namespace = "###";
$header = array(
'authToken' => $this->auth_key,
'clientCustomerId' => $this->client_id,
'userAgent' => $this->ua,
'developerToken' => $this->dev_key
);
$client = new SoapClient($wsdl,$options);
$headers = new SoapHeader($namespace,"RequestHeader",$header,false);
$client->___setSoapHeaders($headers);
}
}
这就是我得到的错误:
PHP致命错误:未捕获的SoapFault异常:[Client]函数(“\uuuuu\u setSoapHeaders”)不是此服务的有效方法
我错过什么了吗?根据这一点,这是一种有效的方法。此外,我还试图搜索我能想到的关于这个的一切,但什么也找不到。非常感谢您的帮助!顺便说一句,我正在运行PHP5.3.3。\uuu setSoapHeaders,只有两个下划线,而不是三个下划线。我知道这样做会很愚蠢。。。总是这样。非常感谢。