[libRETS-users] Invalid Query Type with TREB

779 views
Skip to first unread message

WALTER LEE

unread,
Apr 4, 2013, 5:12:47 PM4/4/13
to libret...@crt.realtors.org
I got the error 'Invalid Query Type' with the following query after login successfully to TREB. Any idea what may be the problem?

Class=RES&Count=1&Format=COMPACT-DECODED&Query=(status%3d|A)&QueryType=DMQL2&SearchType=Property&StandardNames=0* upload completely sent off: 112out of 112 bytes
Server: Apache-Coyote/1.1
RETS-Version: RETS/1.5
cache-control: private
Server: StratusRETS/1.7
Content-Type: text/xml;charset=utf-8
Transfer-Encoding: chunked
Date: Wed, 03 Apr 2013 21:02:40 GMT

<RETS ReplyCode="20203" ReplyText="Invalid Query Type."/>

Furthermore, I am able to run the query using RETS Connector in Windows.

Keith T. Garner

unread,
Apr 5, 2013, 9:41:34 AM4/5/13
to For discussion and help for and by the users of the libRETS C++ library

On Apr 4, 2013, at 4:12 PM, WALTER LEE <walt...@rogers.com> wrote:

> I got the error 'Invalid Query Type' with the following query after login successfully to TREB. Any idea what may be the problem?
>
> Class=RES&Count=1&Format=COMPACT-DECODED&Query=(status%3d|A)&QueryType=DMQL2&SearchType=Property&StandardNames=0* upload completely sent off: 112out of 112 bytes
> Server: Apache-Coyote/1.1
> RETS-Version: RETS/1.5
> cache-control: private
> Server: StratusRETS/1.7
> Content-Type: text/xml;charset=utf-8
> Transfer-Encoding: chunked
> Date: Wed, 03 Apr 2013 21:02:40 GMT
>
> <RETS ReplyCode="20203" ReplyText="Invalid Query Type."/>

The simple thing I can see here is it doesn't like DMQL2 as the query type. The question would be what its expecting.

This may also be that the error reflects something else... such as it may not like the query you built, but its hard to say that without seeing the metadata. It could be the anything, to be honest. QueryType looks okay, which is why I'm thinking it something else.

> Furthermore, I am able to run the query using RETS Connector in Windows.

RETS is a loose enough standard that this doesn't always mean anything.

If you could capture a packet trace for RETS Connector vs what libRETS is doing and narrow it down. The one thing I would do is force libRETS into a RETS/1.7 mode as the server seems to imply its RETS/1.7. It shouldn't really change anything in the query line, but I could be missing something.

Keith

--
Keith T. Garner - kga...@realtors.org - 312-329-3294 - http://realtor.org/
National Association of REALTORS® - VP - Information Technology Services

_______________________________________________
libRETS-users mailing list
libRET...@crt.realtors.org
http://mail.crt.realtors.org/mailman/listinfo/librets-users

WALTER LEE

unread,
Apr 5, 2013, 11:02:27 AM4/5/13
to For discussion and help for and by the users of the libRETS C++ library
It turns out the problem was the class should be 'ResidentialProperty' instead of 'RES'.

Thanks for the help.


From: Keith T. Garner <kga...@crt.realtors.org>
To: For discussion and help for and by the users of the libRETS C++ library <libret...@crt.realtors.org>
Sent: Friday, April 5, 2013 9:41:34 AM
Subject: Re: [libRETS-users] Invalid Query Type with TREB

Mehdi Mirza

unread,
Jan 15, 2014, 10:31:01 PM1/15/14
to lib...@googlegroups.com
Hello,

I am a Toronto based dotnet developer and struggling to get librets-dotnet.dll working for my application. I am using the following code
Dim session As New librets.RetsSession("<serverURL>")
 session.Login("<username>", "<password>")
 
 Dim response As librets.LoginResponse = session.GetLoginResponse()
 
 If response IsNot Nothing AndAlso response.GetUserInfo() <> "" Then
     Debug.WriteLine "Hello, World!"
     'TODO: Do stuff.
     session.Logout()
 End If

When i check the response variable i don't receive anything, can someone help me connect to TREB or provide me links to any documentation to connect and query the RETS server for TREB.

Thanks,

Mark Klein

unread,
Jan 17, 2014, 1:23:58 PM1/17/14
to For discussion and help for and by the users of the libRETS C++ library
On Jan 15, 2014, at 7:31 PM, Mehdi Mirza <mehdi...@gmail.com> wrote:

> Hello,
>
> I am a Toronto based dotnet developer and struggling to get librets-dotnet.dll working for my application. I am using the following code
> Dim session As New librets.RetsSession("<serverURL>")
> session.Login("<username>", "<password>")
>
> Dim response As librets.LoginResponse = session.GetLoginResponse()
>
> If response IsNot Nothing AndAlso response.GetUserInfo() <> "" Then
> Debug.WriteLine "Hello, World!"
> 'TODO: Do stuff.
> session.Logout()
> End If

Try this example code and see what you get:

using System;
using System.IO;
using librets;

public class Login
{
static void Main(string[] args)
{
RetsSession session = null;
try
{
session = new RetsSession(
"http://www.dis.com:6103/rets/login");
if (args.Length == 1)
session.SetHttpLogName(args[0]);
if (!session.Login("Joe", "Schmoe"))
{
Console.WriteLine("Invalid login");
Environment.Exit(1);
}

Console.WriteLine(".Net version: " + System.Environment.Version);

LoginResponse login = session.GetLoginResponse();
Console.WriteLine("Member name: " + login.GetMemberName());

CapabilityUrls capabilityUrls = session.GetCapabilityUrls();
Console.WriteLine("Search URL: " + capabilityUrls.GetSearchUrl());

LogoutResponse logout = session.Logout();
Console.WriteLine("Billing info: " + logout.GetBillingInfo());
Console.WriteLine("Logout message: " + logout.GetLogoutMessage());
Console.WriteLine("Connect time: " + logout.GetConnectTime());
}
finally
{
// Be sure to dispose RetsSession when finished, otherwise the
// TextWriter Dispose() method may be called prior to RetsSession.
if (session != null)
session.Dispose();
}
}
}

If that fails, you need to make sure you have things installed in the proper place and correct security set up for your environment. The stuff I distribute for .NET is unsigned. If your security requires things to be signed, you'll need to self sign the dlls.

Rob Overman

unread,
Jan 17, 2014, 1:07:54 PM1/17/14
to For discussion and help for and by the users of the libRETS C++ library, lib...@googlegroups.com
You are missing the actual assignment of the login response. Check this out...

            Dim response As librets.LoginResponse
            session = New librets.RetsSession(strRETSLoginURL)

            session.SetModeFlags(librets.RetsSession.MODE_NO_EXPECT And librets.RetsSession.MODE_NO_STREAM)

            session.SetRetsVersion(librets.RetsVersion.RETS_1_5)

            session.SetUserAgent(strRETSUserAgent)

            If strRETSUserAgentPassword.Length > 0 Then
                session.SetUserAgentPassword(strRETSUserAgentPassword)
            End If

            Try
                session.Login(strRETSUserName, strRETSPassword)
                response = session.GetLoginResponse()
            Catch ExLogin As librets.RetsExceptionNative
                Console.WriteLine("RETS Connection Error: " + ExLogin.Message)
                System.Diagnostics.Debug.Print("url = " + strRETSLoginURL)
                System.Diagnostics.Debug.Print(ExLogin.Message)
            End Try


Junior Payne

unread,
Jan 17, 2014, 12:45:45 PM1/17/14
to For discussion and help for and by the users of the libRETS C++ library, lib...@googlegroups.com
Hello Mehdi,
I have successfully built a dotnet app for Toronto Treb. I will look at this and see. Give me a few minutes to get back to pc.


Junior Payne,
Logical Custom Solutions

From: Mehdi Mirza
Sent: ‎2014-‎01-‎17 12:42 PM
To: lib...@googlegroups.com

Subject: Re: [libRETS-users] Invalid Query Type with TREB

No Junk For Mallick

unread,
Jun 23, 2018, 11:59:04 AM6/23/18
to LibRets Mirror
getting this below error:

<RETS ReplyCode"20036" ReplyText="Missing or Invalid RETS Version">

any help will be appreciated.

Trying pull the IDX feed from Treb website into my agent website, first time.
Reply all
Reply to author
Forward
0 new messages