无法使用PHRETS类在RETS(REAL ESTATE TRANSACTION SYSTEM)中获取照片

时间:2009-11-06 14:25:44

标签: php

我正在使用PHREST类从RETS服务器获取照片我可以获得其城市,州,邮编和价格,但我无法获得我正在使用以下功能的属性图像

$photos = $rets->GetObject("Property","Photo","05-020123:CLAW",1);
print_r($photos);

在这里我通过了“05-020123:CLAW”这是我从搜索查询列表中获得的UniqueID,我得到了以下结果:

Array
(
    [0] => Array
        (
            [Success] => 
            [Content-Type] => text/xml
            [MIME-Version] => 1.0

            [Length] => 185
            [Data] => 


            [ReplyCode] => 20402
            [ReplyText] => V2.5.0 640: The identifier does not match the KeyField of any data in the resource.  Reason: An resource-entity must only contain digits.
        )

)

请帮帮我。

2 个答案:

答案 0 :(得分:2)

GetObject()的第3个参数只需要是一个ID。

如果您访问www.retsmd.com并使用您的登录信息,您将能够确定您正在寻找的特定RETS课程的KeyField。一旦您知道要查看的字段,请从属性数据中提取该字段中的一个值并将其放置到位。

因此,如果KeyField是“ListingNumber”,您可能会发现1234567作为记录的ListingNumber值。

$photos = $rets->GetObject("Property", "Photo", "1234567");
foreach ($photos as $photo) {
   print_r($photo);
}

那应该为你吐出一些二进制图像数据。检查http://troda.com/projects/phrets/index.php?title=GetObject上的样本以获取更多提示。

答案 1 :(得分:0)

我想建议在照片下载前使用PHRETS请找MLS IDX支持照片的第三方网址

$ rets-> GetObject()和Just var_dump()并检查是否支持第三方网址无需下载照片

如果第三方URL支持,则需要get_curl linux命令获取照片。