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

使用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 乌班图ip地址配置及远程SSH
  • ¥15 怎么让点阵屏显示静态爱心,用keiluVision5写出让点阵屏显示静态爱心的代码,越快越好
  • ¥15 PSPICE制作一个加法器
  • ¥15 javaweb项目无法正常跳转
  • ¥15 VMBox虚拟机无法访问
  • ¥15 skd显示找不到头文件
  • ¥15 机器视觉中图片中长度与真实长度的关系
  • ¥15 fastreport table 怎么只让每页的最下面和最顶部有横线
  • ¥15 R语言卸载之后无法重装,显示电脑存在下载某些较大二进制文件行为,怎么办
  • ¥15 java 的protected权限 ,问题在注释里