Your Step by Step Guide to Installing RETSbond on Your Server
Ok we've been asked for this for awhile, sorry for the delay.Server Requirements
MySQL 4,5 or MSSQL
PHP 4,5
Apache or IIS
Installation
Installing RETSbond is pretty straight forward. Download the appropriate package for either a MySQL database or an MSSQL database and then place those onto your server.
Configuring the Basic Settings
This is the tricky part so we'll walk through each part and discuss what you need to do.
The first item that needs to be addressed is the database information. You should have all this info handy.
$RETSbond['DB']['Server'] = 'localhost';
We're looking for either the ip address, domain name or word localhost for your database server.
$RETSbond['DB']['Username'] = 'Username';
Place the username of the database here.
$RETSbond['DB']['Password'] = 'Password';
Place the Password of the database here.
$RETSbond['DB']['Database'] = 'Database';
Place the name of the Database you want to access and use here.
$RETSbond['DB']['Tables']['Listings'] = 'Listings';
This is the name of the table inside your database that will actually hold your listings. You can use several different tables if you want to spit up each type of property or use one table it's up to you.
$RETSbond['DB']['Field_Names']['Unique_ID'] = 'UID';
This is the field that RETSbond uses to create a unique ID on. This needs to be setup manually in your table and should be set to varchar(20), go ahead and setup indexing on that field to increase the RETSbonds performance. You can change the UID to anything you like just make sure you update this line and also make sure that it woun't be used by anything else. To change UID to Uids for example your line would look like this.
$RETSbond['DB']['Field_Names']['Unique_ID'] = 'Uids';
Your choice but the default is UID.
$RETSbond['DB']['Field_Names']['Property_Type'] = 'PropType';
This field is also used by RETSbond to set the property type manually. The field is similar the above field because it needs to be setup in your database table and you can rename it however you like but the same rules apply to this field. This is very helpful when working with multiple RETSbond files.
$RETSbond['DB']['Field_Names']['MLS_Number'] = 'MLSNum';
This field just tells RETSbond were the MLS Number is stored since we use this for the UID and to index the records. You change MLSNum to whatever you'll be using to store the MLS number on in the database table.
$RETSbond['RETS']['Property_Type'] = 'RES';
Change this to describe the class of property that you will be pulling with this file. Default is RES but you can name it whatever you like. This values is stored in the field designated here
$RETSbond['DB']['Field_Names']['Property_Type'] = 'PropType';
And is used when creating the unique id being stored here
$RETSbond['DB']['Field_Names']['Unique_ID'] = 'Uids';
Make sure you change this for each class that you pull into your database table.
$RETSbond['RETS']['Method'] = 'Insert';
This allows you to control the type of Insert/Update method you'd like to use with RETSbond. Insert only is very fast and efficient and update is a little less quick and not so efficient. We normally suggest using Insert when doing your initial data load and using Update on your day to day record updates. Note that inserts will remove a record and then insert a new one if it already exists and update will update or insert a new record without deleting any records.
Configuring the RETS Server Settings
The information discussed below should have been provided to you from the MLS. If your missing any of the below information please call your MLS or contact us if your not sure what you need to ask for.
$RETSbond['RETS']['Host' = 'rets.mls.com';
This line contains the host url for the rets server make sure that you place your URL only without any additional directories and leave off the http:// since this will cause your license to fail.
$RETSbond['RETS']['Port'] = 6103;
This port number can either be port 6103 or 80. Your MLS provider should state if it is 6103, if they don't say then it's probably port 80.
$RETSbond['RETS']['Version'] = '1.5';
The common version is 1.5, some servers have moved onto 1.7 and very few are still on 1.0. If they don't say what version it's safe to assume 1.5.
$RETSbond['RETS']['Auth_Type'] = 'Basic';
Most RETS servers allow for Basic authentication few require Digest or Digest-QOP. If you try and run RETSbond and it fails switch this to either Digest or Digest-QOP and try to run RETSbond again.
$RETSbond['RETS']['Get_Meta_Path'] = '/rets/GetMetadata';
$RETSbond['RETS']['Get_Object_Path'] = '/rets/GetObject';
$RETSbond['RETS']['Login_Path'] = '/rets/Login';
$RETSbond['RETS']['Search_Path'] = '/rets/Search';
These are the paths to the specific pages to run certain queries on the RETS server. The MLS may only give you the login path but the other paths normally follow the same pattern. So if the MLS provider just gave you the login path like the below
$RETSbond['RETS']['Login_Path'] = '/Login.asmx/Login';
You can quickly fill in the other paths like this example
$RETSbond['RETS']['Get_Meta_Path'] = '/GetMetadata.asmx/GetMetadata';
$RETSbond['RETS']['Get_Object_Path'] = '/GetObject.asmx/GetObject';
$RETSbond['RETS']['Search_Path'] = '/Search.asmx/Search';
$RETSbond['RETS']['Username'] = 'username';
$RETSbond['RETS']['Password'] = 'password';
This is the username and password that your MLS gave you to access the RETS server. These are normally case sensitive.
$RETSbond['RETS']['User_Agent'] = '';
The user agent is something that normally has to be registered with the MLS. If your MLS doesn't require this to be registered then you can place what ever you'd like to in this field
$RETSbond['RETS']['User_Agent'] = 'RETSbond';
$RETSbond['RETS']['User_Agent_Password'] = '';
I've only seen User Agent passwords with the Inter Realty servers. But if your MLS requires a registered User Agent and User Agent Password place the password here.
Getting the MetaData
The meta data is very important it tells you what classes(types) of properties you have access to and also what fields are under those classes. To get the meta data run RETSbond like
http://domain.com/retsbond.php?action=fields This may take a minute but it will spit back XML that you can read when you view the source. Here's an example.
The class='' tells you what the class(type) that you're looking at, in this example it's RESI or Residential.
This is the field that you'll use when mapping to the database.
$RETSbond['RETS']['Field'] = array(
'Local_Field_Name' => 'Remote_Field_Name'
);
This is the mapping area this is what we'll use to map the database and the RETS server together.
Lets use the above field we found (sysid) in the metadata and map it to field in our database called SystemID. It's easy.
$RETSbond['RETS']['Field'] = array(
'SystemID' => 'sysid'
);
You can add more fields in this area like this.
$RETSbond['RETS']['Field'] = array(
'SystemID' => 'sysid'
, 'Beds' => 'Bedrooms'
);
Configuring the Query
Now lets get on to the actual query.
$RETSbond['RETS']['Query'] = array(
'Class' => 'Residential',
'SearchType' => 'Property',
'Limit' => 'none',
'QueryType' => 'DMQL2',
'Format' => 'COMPACT-DECODED',
'Criteria' => array(
'ListPrice' => '1-1000000'
)
);
'Class' => 'RESI',
This line is the class we want to pull data from. We pulled this from the metadata in the above example.
'SearchType' => 'Property',
This line is also pulled from the metadata but is pretty much the same for all RETS servers.
'Limit' => 'none',
The limit is what is used to limit the number of properties pulled. If you want just the first 100 set none to 100.
'QueryType' => 'DMQL2',
This to needs to remain DMQL2.
'Format' => 'COMPACT-DECODED',
Our parsing engine needs this field to remain COMPACT-DECODED but you can change this to COMPACT or STANDARD-XML.
'ListPrice' => '1-1000000'
You can add as much critera as you'd like. The field name, in this example ListPrice, must match the field name in the metadata.
'ListPrice' => '1-1000000',
'ListStatus' => '|A'
The MLS determines what can be searched on so you may need to do trial an error or ask them what can be searched.
Once you've put all of the MLS/RETS info and mapped the database then your ready to go. Just run http://domain.com/retsbond.php and you should start seeing properties load into your database. If you have any questions feel free to contact us.