Go Premium for a chance to win a PS4. Enter to Win

x
?
Solved

How to connect to RETS MLS Data with ColdFusion?

Posted on 2007-11-13
5
Medium Priority
?
3,299 Views
Last Modified: 2013-12-24
A client's MLS company offers realty listing information in the form of RETS xml data.

I've done several xml-based sites, usually reading the xml data into a mySQL database, but from what I am seeing, RETS is a bit different than a usual RSS feed, or visible XML file.

I am looking for sample code, or a UDF / CFC... or a decent tutorial... on connecting to RETS with ColdFusion.

Ideally I could read the data into a mySQL database once per day, and run my own searches and display templates against my familiar cf/db format.

So.. what I'd *really* like, is the code - or an explanation of building same - to read from the RETS server into a SQL insert query. From there I'd be home free.
0
Comment
Question by:MichaelEvangelista
  • 2
  • 2
5 Comments
 
LVL 9

Expert Comment

by:digicidal
ID: 20277911
Well, I've never done anything with RETS, however I would definitely start with going over the documentation and definitions for the protocol revision your client is going to be using.

http://www.rets.org/documentation

After that, there are some other sites that have some articles that might provide a good documentation path for your research:

http://coldfusion.sys-con.com/read/40704.htm

http://www.realestatewebmasters.com/thread5795.html <-- PHP Version here... could be tweaked perhaps.

http://www.realestatewebmasters.com/showthread.php?t=14661&page=2

^^ Read post #17 and #21 on page 3 of the forum... - sadly the PHP Nazi's on this site banned him for calling the guy that said CF was dead and worthless an 'idiot'... which I certainly agree he was... however, he was also a moderator... :D
0
 
LVL 1

Expert Comment

by:splendorx
ID: 20408641
What version of RETS are you trying to access?
0
 

Author Comment

by:MichaelEvangelista
ID: 20408770
They told me it was 1.5, but the 'metadata version' is 2.01 (see below)

I have a url and a username/pw - if I go to the url and log in, I see a short XML file like this:

<RETS ReplyCode="0" ReplyText="Success">

      <RETS-RESPONSE>

MemberName=xxxxxxxxxxx
User=xxxxxxxxxxxx
Broker=xxxxxxxxxx
MetadataVersion=02.01.44653
MinMetadataVersion=02.01.44653
Login=/xxxxxxxxxxxxxxxxx
Search=/xxxxxxxxxxxxxxxxxxx
GetMetadata=/prod_150r10/GetMetadata
GetObject=/prod_150r10/GetObject
Logout=/prod_150r10/Logout
</RETS-RESPONSE>
</RETS>

Beyond that, I am not sure what to do!

I found a free RETS client called VieleRETS (php)
It is easy to set up, and everything seems to be functioning as expected ...
except I am not pulling any listings!
Using the Viele interface, I can see the available columns for the data, and if I choose "Office" as
the resource, I can see that there are a few hundred entries,
but if I choose "Property", and then "Residential" or "Commercial" as the
listing 'class', I get no listings found.

I am obviously well-connected because I am seeing the available fields and
getting success messages for the general connection.
However, both the auto-detect and the debug show some of the responses as
"unauthorized".

I have a feeling I am so close to success, yet something must be wrong
Any help you can give at this point is greatly appreciated!
0
 
LVL 1

Accepted Solution

by:
splendorx earned 2000 total points
ID: 20416679
I have just recently started using RETS 1.5 with CF 8 and it was a little confusing initially.  You have to really read into the RETS documentation because it is not clear.  Here is a function I built to login:

      <cffunction name="getAuthenticated" access="public" returntype="any">
            
            <cfargument name="userName" type="string" required="yes">
            <cfargument name="password" type="string" required="yes">
      
            <!--- First request to get Authenticate Information --->
            <cfhttp url="http://retswebsiteiuse.com/CRMLS/login?rets-version=rets/1.5" method="get" username="#ARGUMENTS.userName#" password="#ARGUMENTS.password#">
                  <cfhttpparam name="Accept" type="header" value="text/xml,text/plain;q=0.5">
                  <cfhttpparam name="User-Agent" type="header" value="#userAgent#">
                  <cfhttpparam name="RETS-Version" type="header" value="#retsVersion#">
            </cfhttp>
            
            <!---
            <cfdump var="#cfhttp#" /><br>
            <cfdump var="#GetHTTPRequestData().headers#">
            --->
            <!--- IMPORTANT--->
            <cfset tempCookie = cfhttp.Responseheader["Set-Cookie"]>
            
            <cfreturn tempCookie>
            
      </cffunction>

The key is to obtain the set-cookie value from the return header response.  You must maintain a session with that value.  Then, pass that value with your next request transaction.  This has successfully worked for me  and not sure what the differences are between the other version of RETS.

Also, I noticed from your initial response that it appears that you do not have access to the search method.  I have not played with the GetObject method yet; perhaps, that will return what you are seeking.

Hope that helps!

Terry
0
 

Author Closing Comment

by:MichaelEvangelista
ID: 31409125
Thanks for the info - I may have more questions to get this working but will assign points now, best answer I got - thanks again
0

Featured Post

Ask an Anonymous Question!

Don't feel intimidated by what you don't know. Ask your question anonymously. It's easy! Learn more and upgrade.

Question has a verified solution.

If you are experiencing a similar issue, please ask a related question

If I have to fix slow responding website my first thoughts are server side optimizations: the database may not be optimized or caching is not enabled, or things like that. We often overlook another major part of our web application: the client. We o…
Thoughout my experience working on eCommerce web applications I have seen applications succumbing to increased user demand and throughput. With increased loads the response times started to spike, which leads to user frustration and lost sales. I ha…
This video teaches viewers how to create their own website using cPanel and Wordpress. Tutorial walks users through how to set up their own domain name from tools like Domain Registrar, Hosting Account, and Wordpress. More specifically, the order in…
This video teaches users how to migrate an existing Wordpress website to a new domain.

783 members asked questions and received personalized solutions in the past 7 days.

Join the community of 500,000 technology professionals and ask your questions.

Join & Ask a Question