newbie trying to connect

355 views
Skip to first unread message

Angie

unread,
Mar 31, 2010, 3:08:11 PM3/31/10
to PHRETS
I'm making my first attempt at populating a website with RETS data and
I'm stuck. I've used the same credentials to connect with RETS
Connector.. but I'm getting an error when I try a simple connection
using phrets. Help?

my debug file:

* About to connect() to rets.filogixdms.com port 8080
* Trying 74.200.28.216... * connected
* Connected to rets.filogixdms.com (74.200.28.216) port 8080
> GET /rets2/rets/login HTTP/1.1
Host: rets.filogixdms.com:8080
Accept: */*
RETS-Version: RETS/1.5
User-Agent: PHRETS/1.0
Accept: */*
RETS-UA-Authorization: Digest 883d22eaea03e1e47ad110904252e21c


< HTTP/1.1 401 Unauthorized
* Added cookie JSESSIONID="52023ABA32BB44E117C80230BFBF98DD" for
domain rets.filogixdms.com, path /rets2, expire 0
< Set-Cookie: JSESSIONID=52023ABA32BB44E117C80230BFBF98DD; Path=/rets2
< WWW-Authenticate: Digest realm="RETS Server", qop="auth",
nonce="98656d43a6ff7c881b4207aeffbe982a",
opaque="51500679e91946626e62e7ee7db1ac1a"
< Content-Type: text/html;charset=ISO-8859-1
< Content-Language: en-CA
< Transfer-Encoding: chunked
< Date: Wed, 31 Mar 2010 18:59:13 GMT
< Server: Apache Coyote/1.0
* Ignoring the response-body
* Connection #0 to host rets.filogixdms.com left intact
* Issue another request to this URL: 'http://rets.filogixdms.com:8080/
rets2/rets/login'
* Re-using existing connection! (#0) with host rets.filogixdms.com
* Connected to rets.filogixdms.com (74.200.28.216) port 8080
* Server auth using Digest with user 'tm_naon'
> GET /rets2/rets/login HTTP/1.1
Authorization: Digest username="tm_naon", realm="RETS Server",
nonce="98656d43a6ff7c881b4207aeffbe982a", uri="/rets2/rets/login",
cnonce="MTI3MDA1", nc=00000001, qop="auth",
response="3406805d3b2eec41a2b3d4d801e4e0ec",
opaque="51500679e91946626e62e7ee7db1ac1a"
Host: rets.filogixdms.com:8080
Accept: */*
Cookie: JSESSIONID=52023ABA32BB44E117C80230BFBF98DD
RETS-Version: RETS/1.5
User-Agent: PHRETS/1.0
Accept: */*
RETS-UA-Authorization: Digest 883d22eaea03e1e47ad110904252e21c


< HTTP/1.1 200 OK
< RETS-Version: RETS/1.5
< Content-Type: text/xml
< Content-Length: 673
< Date: Wed, 31 Mar 2010 18:59:13 GMT
< Server: Apache Coyote/1.0
* Connection #0 to host rets.filogixdms.com left intact
* Closing connection #0


I tried removing the :8080 from the url (based on another post in
here) and all I got was this:

* About to connect() to rets.filogixdms.com port 80
* Trying 74.200.28.216... * Connection refused
* couldn't connect to host
* Closing connection #0


iridiya

unread,
Apr 1, 2010, 10:06:43 AM4/1/10
to PHRETS
It can be because of the User-Agent: PHRETS/1.0. Your RETS server does
not recognize it and does not allow you to connect. At lease that was
the problem in my case when I could not login. Try finding the value
RETS Connector uses and change PHRETS/1.0 to that value to see if
that's the case. Generally, you need to register your User Agent so it
is recognized by the server.
Hope it helps.

Angie

unread,
Apr 1, 2010, 10:37:08 AM4/1/10
to PHRETS
I've looked through all the settings in RetsConnector and I can't find
anything referencing the User-Agent. It can create a javascript which
I'm assuming contains all the details but I'm not seeing anything in
there that will help.

Here it is below in case that'll help:

WScript.Echo("Running script "+"test2");
WScript.Echo("Server Url: "+"http://rets.filogixdms.com:8080/rets2/
rets/login");
WScript.Echo("User Name: "+username);
WScript.Echo("Client Start Time: "+new Date());
var posInScript = "starting script";
var fso = null;
try {
posInScript = "creating FileSystemObject";
fso = new ActiveXObject("Scripting.FileSystemObject");
posInScript = "creating FamlsRetsClient";
var client = new
ActiveXObject("FAMLS.RETS.Client.ComClient.FamlsRetsClient")
posInScript = "logging into the server";
if(client.Login("http://rets.filogixdms.com:8080/rets2/rets/
login",username,password)) {
WScript.Echo("Server login time:
"+client.HttpHeaderValue("Date"));
WScript.Echo("Running step "+"test2");
posInScript = "preparing step "+"test2";
client.SelectTransaction("SEARCH");
client.SetParameter("SearchType","Property");
client.SetParameter("Class","ALL");

client.SetParameter("Select","ADDRESS,BOARD_NUM,CANDATE,CITY,CLOSEDATE,COUNTER,COUNTRY,DISTRICT,DISTRICT_TEXT,ENTRYDATE,EXPDATE,HAC_SHOW_ADDRESS,LA1_A_MBR_ID_NUMBER,LA1_B_MBR_ID_NUMBER,LA1_OFFICE_ID_NUMBER,LA2_A_MBR_ID_NUMBER,LA2_B_MBR_ID_NUMBER,LA2_OFFICE_ID_NUMBER,LASTMODDATE,LISTDATE,LPRICE,MAJOR_AREA,MAJOR_AREA_TEXT,MLSNUM,MLSNUM2,PICTUREID,PROPCODE,PROPERTY_TYPE,PROVINCE,BOARD_ID,SA_A_MBR_ID_NUMBER,SA_B_MBR_ID_NUMBER,SA_OFFICE_ID_NUMBER,SA2_A_MBR_ID_NUMBER,SA2_B_MBR_ID_NUMBER,SA2_OFFICE_ID_NUMBER,SDATE,SDISTRICT,SDISTRICT_TEXT,SPRICE,STATUS,STATUSTEXT,STATUSTEXT_EXT,STREETDIRSUFFIX,STREETNAME,STREETNUMBER,STREETSUFFIX,UNITNUMBER");
client.SetParameter("Format","STANDARD-XML");
client.SetParameter("QueryType","DMQL2");
client.SetParameter("Query","(EXPDATE=NOW-)");
posInScript = "requesting data in step "+"test2";
if(client.Run()) {
posInScript = "creating output file in step "+"test2";
currentFileName = client.CreateTextFile("C:\\Users\\Angie\
\Desktop\\rets\\New folder\\searchresults.xml",3)
if(currentFileName.length=="") {
WScript.Echo("ERROR: Unable to create data file "+"C:\
\Users\\Angie\\Desktop\\rets\\New folder\\searchresults.xml");
} else {
var f = fso.OpenTextFile("C:\\Users\\Angie\\Desktop\
\rets\\New folder\\searchresults.xml",8,true,-1);
var line;
posInScript = "reading server data in step "+"test2";
while((line = client.ReadLine()) != null) {
posInScript = "processing data in step "+"test2";
posInScript = "reading server data in step
"+"test2";
}
posInScript = "closing output file in step "+"test2";
f.Close();
WScript.Echo("Data file: "+"C:\\Users\\Angie\\Desktop\
\rets\\New folder\\searchresults.xml");
posInScript = "checking status code in step "+"test2";
switch(client.RetsStatusCode) {
case 0:
case 20201:
case 20208:
WScript.Echo("Data downloaded. RETS Status
code = "+client.RetsStatusCode);
break;
default:
WScript.Echo("ERROR downloading data: RETS
Status code = "+client.RetsStatusCode);
break;
}
WScript.Echo("RETS Status text:
"+client.RetsStatusText);
}
} else {
posInScript = "reporting failure in step "+"test2";
WScript.Echo("ERROR in step "+"test2"+". Client failed:
"+client.ResponseError);
}
posInScript = "closing step "+"test2";
} else {
WScript.Echo("ERROR: Unable to log into server.
"+client.LoginText);
}
} catch(ex) {
WScript.Echo("ERROR while "+posInScript+": "+
(ex.toString()=="[object Error]" ? ex.message : ex));
} finally {
client = null;
fso = null;
}

Troy Davisson

unread,
Apr 1, 2010, 10:54:32 AM4/1/10
to phr...@googlegroups.com
The original debug output was fine.  In HTTP when using Digest authentication, the first response has to be a 401 Unauthorized.  This response from the server gives your end what it needs to correctly calculate the authentication codes.  PHRETS will re-request Login again and the server replies with a 200 OK response which says you're in.



}

--
You received this message because you are subscribed to the Google Groups "PHRETS" group.
To post to this group, send email to phr...@googlegroups.com.
To unsubscribe from this group, send email to phrets+un...@googlegroups.com.
For more options, visit this group at http://groups.google.com/group/phrets?hl=en.


Angie

unread,
Apr 1, 2010, 12:18:05 PM4/1/10
to PHRETS
Ahh, ok. I've managed to get some results working now.. thanks!

I now have a new problem, but I'll post that in a new thread.

Reply all
Reply to author
Forward
0 new messages