phRETS FNIS connect

187 views
Skip to first unread message

featherhooks

unread,
Aug 10, 2009, 5:09:20 PM8/10/09
to PHRETS
I need to connect to both FNIS and FBS.
I use phRETS for FBS and it works great!

I am having a problem with phRETS FNIS connection.
I have studied phRETS documentation and this group posts.
When I use RetsConnect on my local system I connect fine and download
data.
When I use http://www.idxadvantage.com/rets-setup/ I connect fine and
see complete table structure.
When I use retsmd.com online I connect fine and see all MetaData, but
I must check Force Basic Auth.: Yes

When I try to run this php script (that I use for FBS with success):

=======================
require ('phRETS.php');

$rets = new phRETS;

$rets->AddHeader("Accept", "*/*");
$rets->AddHeader("RETS-Version", "RETS/1.5");
$rets->AddHeader("User-Agent", "PHRETS/1.0");

$rets->SetParam("cookie_file", "phrets_cookies.txt");
$rets->SetParam("debug_mode", true);
$rets->SetParam("force_basic_authentication", true);

$rets->Connect("http://glarmls.rets.fnismls.com/rets/fnisrets.aspx/
GLARMLS/login", "myusername", "mypassword");

echo"connected";

$rets->Disconnect();

=======================

rets_debug.txt returns this:

< HTTP/1.1 401 Invalid Username/Password combination
< Date: Mon, 10 Aug 2009 20:58:37 GMT
< Server: Microsoft-IIS/6.0
< X-Powered-By: ASP.NET
< X-UA-Compatible: IE=EmulateIE7
< X-AspNet-Version: 2.0.50727
< RETS-Server: RETS-Paragon/1.0
< RETS-Version: RETS/1.5
< WWW-Authenticate: Digest
qop="auth",realm="GLARMLS",nonce="2009-08-10T16:08:37",opaque="",stale="false",domain="\rets
\fnisrets.aspx\GLARMLS"
< Cache-Control: private
< Expires: Mon, 01 Jan 0001 00:00:00 GMT
< Content-Length: 0
<
* Connection #0 to host glarmls.rets.fnismls.com left intact
* Issue another request to this URL: 'http://glarmls.rets.fnismls.com:
80/rets/fnisrets.aspx/GLARMLS/login'
* Re-using existing connection! (#0) with host
glarmls.rets.fnismls.com
* Connected to glarmls.rets.fnismls.com (208.93.241.14) port 80 (#0)
* Server auth using Digest with user 'acmewebwerks'
> GET /rets/fnisrets.aspx/GLARMLS/login HTTP/1.1
Authorization: Digest username="acmewebwerks", realm="GLARMLS",
nonce="2009-08-10T16:08:37", uri="/rets/fnisrets.aspx/GLARMLS/login",
cnonce="MTI0OTkz", nc=00000001, qop="auth",
response="f097dd6a54f2fae07a9f2b212c1b9322", opaque=""""
Host: glarmls.rets.fnismls.com
Accept: */*
RETS-Version: RETS/1.5
User-Agent: PHRETS/1.0
< HTTP/1.1 401 Nonce Expired
< Date: Mon, 10 Aug 2009 20:58:37 GMT
< Server: Microsoft-IIS/6.0
< X-Powered-By: ASP.NET
< X-UA-Compatible: IE=EmulateIE7
< X-AspNet-Version: 2.0.50727
< RETS-Server: RETS-Paragon/1.0
< RETS-Version: RETS/1.5
* Authentication problem. Ignoring this.
< WWW-Authenticate: Digest
qop="auth",realm="GLARMLS",nonce="2009-08-10T16:08:37.79929e56b8dada6c1ecdb2ab8b9a1e51",opaque="",stale="true",domain="\rets
\fnisrets.aspx\GLARMLS"
< Cache-Control: private
< Expires: Mon, 01 Jan 0001 00:00:00 GMT
< Content-Length: 0
<
* Connection #0 to host glarmls.rets.fnismls.com left intact
* Closing connection #0

=======================

I have tried it using:

$rets->SetParam("force_basic_authentication", false);

and

//$rets->SetParam("force_basic_authentication", true);

with the same result.

It just seems odd to me that the login would work ok using other
methods but not this one.

I suspect I am overlooking something simple...

tashworth

unread,
Aug 11, 2009, 9:55:28 AM8/11/09
to PHRETS
Have you read down below on one of my post, Troy and I were discussing
changing a line in the code that worked for me. I will look and see
if I can cut and paste it here.

Tom



On Aug 10, 3:09 pm, featherhooks <featherho...@gmail.com> wrote:
> I need to connect to both FNIS and FBS.
> I use phRETS for FBS and it works great!
>
> I am having a problem with phRETS FNIS connection.
> I have studied phRETS documentation and this group posts.
> When I use RetsConnect on my local system I connect fine and download
> data.
> When I usehttp://www.idxadvantage.com/rets-setup/I connect fine and
> qop="auth",realm="GLARMLS",nonce="2009-08-10T16:08:37",opaque="",stale="fal­se",domain="\rets
> qop="auth",realm="GLARMLS",nonce="2009-08-10T16:08:37.79929e56b8dada6c1ecdb­2ab8b9a1e51",opaque="",stale="true",domain="\rets

tashworth

unread,
Aug 11, 2009, 9:58:29 AM8/11/09
to PHRETS
Here is a cut and paste of my message to Troy a few weeks ago. I hope
it helps.. Tom

Troy, Thanks for getting back to me so quick. I tried the changes
you suggested and still gave me the connection error, but I changed

curl_setopt($this->ch, CURLOPT_HTTPAUTH, CURLAUTH_DIGEST|
CURLAUTH_BASIC);


to this


curl_setopt($this->ch, CURLOPT_HTTPAUTH, CURLAUTH_BASIC);


and it connects fine now.


So I am not sure why your suggestion did not work. I really do not
like having custom code, in case I want to upgrade as you do future
releases.




On Aug 11, 7:55 am, tashworth <supp...@ashworthservices.com> wrote:
> Have you read down below on one of my post, Troy and I were discussing
> changing a line in the code that worked for me.  I will look and see
> if I can cut and paste it here.
>
> Tom
>
> On Aug 10, 3:09 pm, featherhooks <featherho...@gmail.com> wrote:
>
>
>
> > I need to connect to both FNIS and FBS.
> > I use phRETS for FBS and it works great!
>
> > I am having a problem with phRETS FNIS connection.
> > I have studied phRETS documentation and this group posts.
> > When I use RetsConnect on my local system I connect fine and download
> > data.
> > When I usehttp://www.idxadvantage.com/rets-setup/Iconnect fine and
> > I suspect I am overlooking something simple...- Hide quoted text -
>
> - Show quoted text -

featherhooks

unread,
Aug 11, 2009, 1:16:10 PM8/11/09
to PHRETS
Thanks Tom,

I did in fact read the thread between you and Troy and I did modify
the class as suggested.

Same result however. Login fails. This is the error:

Fatal error: Response from Server (401) Not-OK: in /home/acmeweb/
public_html/rets/phRETS.php on line 768

I suspect it must be something else, a parameter maybe I am not
passing, since the login works using phRETS with retsmd.com

FH

Troy Davisson

unread,
Aug 11, 2009, 4:32:25 PM8/11/09
to phr...@googlegroups.com
I sent you an email privately last night with the updated PHRETS code.  Is it still not working with that code?  If not, can you send me (off-list if you prefer) the top part of your script that makes the connection?  Since it works on retsmd.com, it's probably something small I'm not thinking of.  For example, there might be an extra space after the login url, username or password (which I updated retsmd.com to take care of recently).

featherhooks

unread,
Aug 11, 2009, 8:25:41 PM8/11/09
to PHRETS
The updated phRETS code work like a champ with both FNIS and FBS
logins and delivers to goods!

Thank you Troy for your prompt and kind attention.

Thank you Tom for your suggestion.

You guys are great, and what a very nice piece of code it is!

FH
Reply all
Reply to author
Forward
0 new messages