[libRETS-users] HTTP 503 logging in to RealTracs

402 views
Skip to first unread message

Van Order, Drew (US - Hermitage)

unread,
Jan 17, 2014, 11:21:24 AM1/17/14
to libret...@crt.realtors.org

I must be doing something simple wrong regarding building a session object that works with RealTracs—can’t login using current x64 libRETS in Visual Studio 2013 (build properties are 64 bit and .NET 4). Below are two examples, though I have tried just about every combination, all resulting in a 503 returned.

 

Exception written is: Could not get URL [ http://rets.realtracs.com:6103/rets/login] - HTTP response code: 503

 

I have referenced librets-dotnet.dll and added unmanaged code librets-pinvoke.dll as an item to the VS project. I left the commented line for UserAgentPassword to show that was tried as well (even though I don’t have one)

 

GetLoginUrl() returns http://rets.realtracs.com:6103/rets/login

 

using System;

using System.Collections.Generic;

using System.Linq;

using System.Text;

using System.Threading.Tasks;

using librets;

 

namespace libRETSTest

{

    class Program

    {

        static void Main(string[] args)

        {

 

            try

            {

                RetsSession session = new RetsSession("http://rets.realtracs.com:6103/rets/login");

                session.SetHttpLogName("c:\\temp\\librets.log");

                session.SetUserAgent("MyUserAgent/1.0");

                //session.SetUserAgentAuthType(UserAgentAuthType.USER_AGENT_AUTH_RETS_1_7);

                session.SetUserAgentAuthType(UserAgentAuthType.USER_AGENT_AUTH_INTEREALTY);

                //session.SetUserAgentPassword();

                string returnedUrl = session.GetLoginUrl();

                Console.Write(returnedUrl);

                session.Login("MyUserName", "xxxxxxxx");

            }

            catch (Exception ex)

            {

                Console.Write(ex.Message);

            }

        }

    }

}

 

 

* About to connect() to rets.realtracs.com port 6103 (#0)

*   Trying 216.76.30.79... * Connected to rets.realtracs.com (216.76.30.79) port 6103 (#0)

>>> Sent

GET /rets/login HTTP/1.1

Host: rets.realtracs.com:6103

Accept: */*

RETS-Version: RETS/1.5

User-Agent: MyUserAgent/1.0

X-Librets-Version: 1.5.3, libCURL - libcurl/7.19.7 OpenSSL/0.9.8l

* Closing connection #0

 

 

Now I try the other option. Still get the 503, logging changes slightly

 

session.SetUserAgentAuthType(UserAgentAuthType.USER_AGENT_AUTH_RETS_1_7);

//session.SetUserAgentAuthType(UserAgentAuthType.USER_AGENT_AUTH_INTEREALTY);

 

* About to connect() to rets.realtracs.com port 6103 (#0)

*   Trying 216.76.30.79... * Connected to rets.realtracs.com (216.76.30.79) port 6103 (#0)

>>> Sent

GET /rets/login HTTP/1.1

Host: rets.realtracs.com:6103

Accept: */*

RETS-Version: RETS/1.5

User-Agent: MyUserAgent/1.0

X-Librets-Version: 1.5.3, libCURL - libcurl/7.19.7 OpenSSL/0.9.8l

* Expire cleared

* Closing connection #0

 

Any insight is appreciated, thank you in advance--Drew

 



 

 


This message (including any attachments) contains confidential information intended for a specific individual and purpose, and is protected by law. If you are not the intended recipient, you should delete this message and any disclosure, copying, or distribution of this message, or the taking of any action based on it, by you is strictly prohibited.

v.E.1


 

 

 

Mark Klein

unread,
Jan 17, 2014, 11:32:10 AM1/17/14
to For discussion and help for and by the users of the libRETS C++ library
On Jan 17, 2014, at 8:21 AM, "Van Order, Drew (US - Hermitage)" <dvan...@deloitte.com> wrote:

> I must be doing something simple wrong regarding building a session object that works with RealTracs—can’t login using current x64 libRETS in Visual Studio 2013 (build properties are 64 bit and .NET 4). Below are two examples, though I have tried just about every combination, all resulting in a 503 returned.
>
> Exception written is: Could not get URL [ http://rets.realtracs.com:6103/rets/login] - HTTP response code: 503

Way too many variables here. The 503 is "Service Unavailable". That could simply be the server is undergoing maintenance and disabled. Try again in a bit, if you get the same response, then confirm you have the proper URL. Also find out if they require user agent authentication and if so, what the user agent should be and if it requires a password.

Regards,



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

Van Order, Drew (US - Hermitage)

unread,
Jan 17, 2014, 2:11:45 PM1/17/14
to libret...@crt.realtors.org

Thanks for the quick reply Mark. Below is the connection information provided by RealTracs, I should have provided this earlier. It seems I require UserAgent in the librets session object, but there’s no UserAgent password.

 

RETS URL: http://rets.realtracs.com:6103/rets/login

RETS Login: MyLogin

RETS Password: xxxxxx

RETS UserAgent: MyLogin/1.0

RETS Version 1.7.2

 

The 503 is puzzling because I can login to RETS M.D. web site using this. RealTracs has a free Pipeline client that I have also connected successfully with, but Windows 8.1/my laptop don’t seem to get along with it.

 

I sent RealTracs this login question last night, but have not gotten a response—so that’s why I’m trying here.

 

Thanks again--Drew

 

 

Mark Klein

unread,
Jan 17, 2014, 2:21:46 PM1/17/14
to For discussion and help for and by the users of the libRETS C++ library
On Jan 17, 2014, at 11:11 AM, "Van Order, Drew (US - Hermitage)" <dvan...@deloitte.com> wrote:

>
> Thanks for the quick reply Mark. Below is the connection information provided by RealTracs, I should have provided this earlier. It seems I require UserAgent in the librets session object, but there’s no UserAgent password.
>
> RETS URL: http://rets.realtracs.com:6103/rets/login
> RETS Login: MyLogin
> RETS Password: xxxxxx
> RETS UserAgent: MyLogin/1.0

The user agent is different from what you have in your example. You need to make them match.

Keith T. Garner

unread,
Jan 17, 2014, 2:21:59 PM1/17/14
to For discussion and help for and by the users of the libRETS C++ library
A few things...

In the code you sent earlier I noticed:  session.SetUserAgentAuthType(UserAgentAuthType.USER_AGENT_AUTH_INTEREALTY);  Since they don't give you a UserAgent Password, you don't need to set it.  I don't think it would cause this as a side effect, but it can't hurt to NOT do the work you don't need to do.

Login returns a boolean value, you're not checking that, you really should.

The biggest problem might be that you are sending RETS/1.5 as the version.  You should probably explicitly set the rets version on the session to 1.7.2 since you specified that in this past e-mail.  Checkout RetsSession.setRetsVersion
_______________________________________________
libRETS-users mailing list
libRET...@crt.realtors.org
http://mail.crt.realtors.org/mailman/listinfo/librets-users

-- 
National Association of REALTORS® - VP - Information Technology Services

Reply all
Reply to author
Forward
0 new messages