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.