If you're interested in using just the RETS client library that we're developing as part of CART, you can download it here:
- Binary distributions: rets-client-1.0.2.tar.gz, rets-client-1.0.2.zip.
- Source distributions: rets-client-1.0.2-src.tar.gz, rets-client-1.0.2-src.zip.
This library uses several external packages which you will need:
-
Jakarta Commons HttpClient
Used for the HTTP protocol. This code is currently developed against version 2.0. -
Jakarta Commons Lang
Includes various java utility classes. -
Jakarta Commons Logging
Used for flexible logging to log4j or java 1.4 logging. Required by commons-httpclient so we use it as well. -
jdom
An XML document API, less cumbersome than the W3C's DOM. -
log4j
A logging API. With java 1.4 you don't strictly need this, as commons-logging will pick up the java 1.4 logging classes instead. Cart does use log4j specifically. - SAX
You will need a JAXP-compliant SAX parser. Cart uses Xerces, but Java 1.4 ships with a JAXP SAX parser that will work just fine.
Using the library
First off, the javadocs are right here.
Now, here's a brief sample. More documentation is coming.
import org.realtors.rets.client.RetsSession;
import org.realtors.rets.client.SearchRequest;
import org.realtors.rets.client.SearchResult;
class RetsTest {
public static void main (String args) {
RetsSession session = new RetsSession(
"http://demo.crt.realtors.org:6103/login");
// implicitly calls getMetadata()
session.login("Username", "Password");
SearchRequest req = new SearchRequest(
"Property", "ResidentialProperty", "(LP=300000-)");
SearchResult res = session.search(req);
session.logout();
}
}
Status
The following transactions are supported: Login, GetMetadata, Search, GetObject (one object only, no multiple object requests), Logout. Update will be supported in a future release.