Yeah, thanks for that, RESOURCE is more interesting...
Now we are getting somewhere. Anyone familier with MLS data will recognize these as the top level of MLS databases. I ommited the last two for space, OpenHouse and Tour, but you get the idea. The Property resource is what it is all about, and we can tell there are 18 classes under it, and the key field is LN (ListingNumber). Before we proceed, lets run down the code used to pull the metadata.
Again, nothing fancy for the demostration purposes. We are ACCEPTing anthing the server chooses to send us back. We are passing the first row from the application.RetsCookie struct that we set earilier. The last three arguments is where it all happens, and where reading the spec will come in handy. TYPE and ID are how you navigate the nodes, FORMAT determines what the returned XML will look like. There are three FORMAT values, COMPACT, COMPACT-DECODED and XML-STANDARD. For pulling metadata, the FORMATS don't really matter much (at least as far as I can tell, I am still learning). Try pulling the same node in each and you will see what I mean. The FORMAT will be critical when pulling actual data later, so we will come back to that. I am going to cut to the chase and tell you what TYPEs and IDs I pulled to get what I needed. Use format COMPACT for now.
- Type=METADATA-RESOURCE, ID=0
- Type=METADATA-CLASS, ID=0
- Type=METADATA-TABLE, ID=0
- Type=METADATA-LOOKUP, ID=0
- Type=METADATA-LOOKUP_TYPE, ID=0
Browse the XML files and you should start to get a pretty good handle on where things are headed. Next up, let's do something with this METADATA...