Issue connecting to RETS server and getting data

550 views
Skip to first unread message

Todd Warne

unread,
Jun 5, 2016, 7:31:20 PM6/5/16
to PHRETS
I haven't been able to resolve this per issue #94

I changed to 1.7.2 but still getting the same error. I know the info is right, I am able to login to the retsmd site with those credentials. Also checked with the ARMLS support staff and they told me my information is all correct. 

(RETS MD site)
http://www.retsmd.com/index.php

My test page as seen below in php is at the following location

The response from the page is as follows:

Fatal error: Uncaught exception 'PHRETS\Exceptions\CapabilityUnavailable' with message ''GetMetadata' tried but no valid endpoint was found. Did you forget to Login()?' in /home/getarizonareales/public_html/RETS/src/Session.php:329 Stack trace: 
#0 /home/getarizonareales/public_html/RETS/src/Session.php(256): PHRETS\Session->request('GetMetadata', Array) 
#1 /home/getarizonareales/public_html/RETS/src/Session.php(169): PHRETS\Session->MakeMetadataRequest('METADATA-SYSTEM', 0, 'metadata.system')
#2 /home/getarizonareales/public_html/RETS/index.php(27): PHRETS\Session->GetSystemMetadata() 
#3 {main} thrown in /home/getarizonareales/public_html/RETS/src/Session.php on line 329

My Log File looks like the Login works, it get a success 200 response as follows:

[2016-01-02 16:20:54] PHRETS.DEBUG: Loading Monolog\Logger logger [] []
[2016-01-02 16:20:54] PHRETS.DEBUG: Sending HTTP Request forhttp://retsgw.flexmls.com:6103/rets2_1/Login (Login) {"headers":{"User-Agent":"PHRETS/2.0","RETS-Version":"RETS/1.8","Accept-Encoding":"gzip","Accept":"/"},"cookies":[]} []
[2016-01-02 16:20:54] PHRETS.DEBUG: Response: HTTP 200 [] []

My PHP code is as follows:

<?php

date_default_timezone_set('America/Phoenix');

require_once("vendor/autoload.php");

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

$config = new \PHRETS\Configuration;
$config->setLoginUrl('http://retsgw.flexmls.com:6103/rets2_1/Login')
        ->setUsername('HIDDEN')
        ->setPassword('HIDDEN')
        ->setRetsVersion('1.8') // see constants from \PHRETS\Versions\RETSVersion
        ->setHttpAuthenticationMethod('digest') // or 'basic' if required 
        ->setOption('use_post_method', false) // boolean
        ->setOption('disable_follow_location', false); // boolean

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

$connect = $rets->Login();

$system = $rets->GetSystemMetadata();
var_dump($system);


It seems there are others on the internet who have had this same issue but have not been able to resolve it. Thoughts?

Claudia Mansilla

unread,
Jun 10, 2016, 3:24:01 PM6/10/16
to PHRETS
From my own experience I can say that the error "GetMetadata' tried but no valid endpoint was found. Did you forget to Login()?" is usually tied to some restriction on the mls end, for example like IP restriction.
You should ask the mls tech person if they restrict by ip.
Reply all
Reply to author
Forward
0 new messages