Softlayer API PHP错误函数(“setObjectFilter”)不是此服务的有效方法


Softlayer API PHP error Function ("setObjectFilter") is not a valid method for this service

我试图使用对象过滤器来获取有效的设备:

以下是php代码:

$client= SoftLayer_SoapClient::getClient('SoftLayer_Account', null, $username, $apiKey);
    $filter = new stdClass();
    $filter->applicationDeliveryControllers = new stdClass();
    $filter->applicationDeliveryControllers->billingItem = new stdClass();
    $filter->applicationDeliveryControllers->billingItem->id = new stdClass();
    $filter->applicationDeliveryControllers->billingItem->id->operation = new stdClass();
    $filter->applicationDeliveryControllers->billingItem->id->operation = $bId;
    $client->setObjectFilter($filter);  
    try {
          $mask ='mask[id, name]';
            $client->setObjectMask($mask);
        $myInstance = $clientNetscaler->getApplicationDeliveryControllers();
    } catch(exception $ex) {
    } 

我在运行时环境中出现以下错误:

查询SoftLayer API时出错:函数("setObjectFilter")不是此服务的有效方法

错误来自线路$client->setObjectFilter($filter);

有人知道为什么会有这样的错误吗?

对我来说,过滤器运行良好。以防万一,我复制了我的代码。请确保您拥有PHP 5.2.3或更高版本以及用于SOAP的PHP扩展。同时尝试重新下载Softlayer PHP客户端https://github.com/softlayer/softlayer-api-php-client然后再试一次。

问候

<?php
 require_once ('/SoapClient.class.php');
 $apiUsername = 'set me';
$apiKey = 'set me';
$accountService = Softlayer_SoapClient::getClient('SoftLayer_Account', null,$apiUsername, $apiKey);
$bId = 51774239;
$filter = new stdClass();
$filter->applicationDeliveryControllers = new stdClass();
$filter->applicationDeliveryControllers->billingItem = new stdClass();
$filter->applicationDeliveryControllers->billingItem->id = new stdClass();
$filter->applicationDeliveryControllers->billingItem->id->operation = new     stdClass();
$filter->applicationDeliveryControllers->billingItem->id->operation = $bId;
$accountService->setObjectFilter($filter);  
$mask ='mask[id, name]';
$accountService->setObjectMask($mask);
try {
    $myInstance  = $accountService->getApplicationDeliveryControllers();
    print_r($myInstance);
} catch (Exception $e) {
    die('Unable to executre the request. ' . $e->getMessage());
}