PHRETS
PHRETS copied to clipboard
Version 2.0 returns zero results
Brief
I have a previous version of phRETS and doing a little updating. Tried updating this dependency but it seems using version 2.0 always returns zero results
Code 1.x
$rets = new phRETS();
$rets->Connect(env('crea_host'), env('crea_username'), env('crea_password'));
$results = $rets->SearchQuery("Property", "Property", "LastUpdated=2015-01-01", [
'Format' => "STANDARD-XML",
'Count' => 1,
'Limit' => 100,
]);
dd($results)
Code 2.0 attempt
$config = new Configuration();
$config->setLoginUrl(env('CREA_URL'))
->setUsername(env('CREA_USERNAME'))
->setPassword(env('CREA_PASSWORD'))
->setRetsVersion('1.7.2');
$client = new Session($config);
$connection = $client->login();
$results = $client->Search('Property', 'Property', 'LastUpdated=2015-01-01', [
'Format' => "STANDARD-XML",
'Count' => 1,
'Limit' => 3,
]);
dd($results);
Looks like the parser is unable to parse when the format is STANDARD-XML
. Changing it to COMPACT-DECODED
worked for me.
When the format is STANDARD-XML
the parser complains about 'No delimiter found' and fails to parse any of the records.
Is there a resolution to this Troy? I'd pay for this to be resolved.
Last I knew (and still seems to be true), CREA's RETS server wasn't actually compliant with the RETS standard. When you request STANDARD-XML, servers respond in a completely different format which is much more verbose compared to COMPACT or COMPACT-DECODED. I also thought that I'd seen CREA distributing a modified version of PHRETS 1.x which worked around the differences.
I don't personally have active credentials for a feed from that server so I can't confirm what's happening, but that's what it sounds like.
Troy - yes you are correct. They had a butchered version of it, 1.02rc that was modified to work with the XML.
The solution that Paul-DS suggested on this thread worked for me: https://github.com/troydavisson/PHRETS/issues/99