2

我正在使用 libRets for .NET,并使用有效的用户帐户查询http://retsgw.flexmls.com/rets2_1/ 。在 C# 中,调用 Search() 后,我使用 GetCount() 检查计数,得到 6300 个结果,但是当我调用 HasNext() 第一次返回时false

检查 XML 响应,即使结果计数提供了一个数字,结果看起来也是空的 ()。

那么……结果去哪儿了?

确切的查询如下:

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

这是请求:

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

以下是提出请求的方式:

SearchResultSet result = client.Search(request);

以下是结果的处理方式:

while (result.HasNext()) {
    // Do something
}
4

2 回答 2

5

因此,看起来 FlexMLS 支持能够提供帮助(相当快)。

我需要添加&Format=COMPACT-DECODED到查询字符串。

所以,在代码中它看起来像这样:

request.SetFormatType(SearchRequest.FormatType.COMPACT_DECODED);
于 2014-05-30T18:13:01.093 回答
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.

于 2014-05-29T14:41:53.453 回答