「已注销」 2016-07-18 14:45
浏览 21
已采纳

使用RET中的RETS数据获取Feed的问题

I am using the PHRETS PHP library to fetch the RETS data from the rets API. I have and issue with getting the Data. It's giving me the Requested Class not found Error. Please help to solve this Error. My Code is:

date_default_timezone_set('America/New_York');

require_once("vendor/autoload.php");

$log = new \Monolog\Logger('PHRETS');
$log->pushHandler(new \Monolog\Handler\StreamHandler('php://stdout', \Monolog\Logger::DEBUG));



$config = new \PHRETS\Configuration;
$config->setLoginUrl('http://rets.navicamls.net/login.aspx')
        ->setUsername('xxx')
        ->setPassword('xxx')
        ->setRetsVersion('1.7.2');

$rets = new \PHRETS\Session($config);
$rets->setLogger($log);

$connect = $rets->Login();


if ($connect) {
 echo "Connected!<br>";
}
else {
 echo "Not Connected!<br>";
 print_r($rets->Error());
 exit;
}


//results consists of Property, class, and query
$results = $rets->Search(
    "Property",
    "A",
    "*",
    [
        'QueryType' => 'DMQL2',
        'Count' => 1, // count and records
        'Format' => 'COMPACT-DECODED',
        'Limit' => 10,
        'StandardNames' => 0, // give system names
    ]
);

print_r($results); exit;
  • 写回答

1条回答 默认 最新

  • dongtan7639 2016-07-19 12:11
    关注

    You need to first verify the name of the class in your search query is correct by looking up the metadata.

    1. Use RETSMD.com and enter the RETS Server login url, username, and password.
    2. Use the metadata functions in the PHRETS documentation on the main page

      a. $system = $rets->GetSystemMetadata();

      b. $classes = $rets->GetClassesMetadata('Property');

    本回答被题主选为最佳回答 , 对您是否有帮助呢?
    评论

报告相同问题?

悬赏问题

  • ¥15 DIFY API Endpoint 问题。
  • ¥20 sub地址DHCP问题
  • ¥15 delta降尺度计算的一些细节,有偿
  • ¥15 Arduino红外遥控代码有问题
  • ¥15 数值计算离散正交多项式
  • ¥30 数值计算均差系数编程
  • ¥15 redis-full-check比较 两个集群的数据出错
  • ¥15 Matlab编程问题
  • ¥15 训练的多模态特征融合模型准确度很低怎么办
  • ¥15 kylin启动报错log4j类冲突