2

I am using libRets for .NET, and querying http://retsgw.flexmls.com/rets2_1/, using a valid user account. From C#, after calling Search() I check the count using GetCount() and I get 6300 results, but when I call HasNext() the first time returns false.

Checking the XML response, it looks like the results are empty () even though the result count provides a number.

So... where did the results go?

The exact query is the following:

http://retsgw.flexmls.com/rets2_1/Search?Class=OpenHouse&Count=1&QueryType=DMQL2&SearchType=OpenHouse&Select=ListingID&StandardNames=1

Here is the request:

SearchRequest request = client.CreateSearchRequest("OpenHouse", "OpenHouse", "");
request.SetStandardNames(true);
request.SetSelect("ListingID");

Here is how the request is made:

SearchResultSet result = client.Search(request);

Here is how the result is handled:

while (result.HasNext()) {
    // Do something
}
Biagio Arobba
  • 1,075
  • 11
  • 27
  • You might want to show the problematic code. –  May 23 '14 at 22:26
  • Yes, but the code isn't the problem. I'll add some code if it helps you with context. When following the URL, you would see the XML file that I get. What would cause that? – Biagio Arobba May 23 '14 at 22:30
  • Or... Which spot in the code would you be more interested? The login, the authentication, the query preparation, the result handling? Or how about the network calls that the client library makes? Or the XML responses? – Biagio Arobba May 23 '14 at 22:37
  • You say the network calls and the XML is in order, so not those. The login and authentication and query preparation must work too, otherwise you won't get valid responses. That leaves the result handling. –  May 23 '14 at 22:50

2 Answers2

5

So, it looks like the FlexMLS Support was able to help (rather quickly).

I needed to add &Format=COMPACT-DECODED to the query string.

So, in the code it would look like this:

request.SetFormatType(SearchRequest.FormatType.COMPACT_DECODED);
Biagio Arobba
  • 1,075
  • 11
  • 27
  • 1
    Thanks, my MLS provider also had the same requirements, and I couldn't find any info about it – Regneel Jul 26 '14 at 21:05
1

1) You are setting StandardNames to true AND then setting a selection. That selection may not exist in StandardNames. (You're reviewed the metadata returned by the server, right?) Its possible the server doesn't take the select into account when doing the count, but does on a full query, therefor it doesn't have any information to send back because it doesn't have a Table matching what you selected. What happens when you don't set the Select?

2) Have you done a packet trace or set libRETS to log the network traffic to a file? (I can't tell if that's what you mean by "Checking the XML response, it looks like the results are empty () even though the result count provides a number.") If you haven't, do that and see if the server is passing back any information.

If the server is passing pack information, you might have discovered a bug in libRETS and I invite you to join the libRETS-users mailing list and share this data (and that network trace) there.

If the server is passing back 0 results, you'll may need to contact your MLS and/or FlexMLS to see if you don't have permissions to view the results. Some RETS servers have fine grained results where you could get the count, but not get the data.

ktgeek
  • 21
  • 3
  • Good thought on removing the SetSelect(), but it didn't help. Also, yes I did review the metadata returned by the server :/ I did set libRETS to log the network traffic to a file. The logs make it seem like everything is processing normally, so maybe it is a server or account issue. – Biagio Arobba May 30 '14 at 15:28
  • I'm emailing FlexMLS support to see if it's a permission issue. – Biagio Arobba May 30 '14 at 16:37