Closed zBestData closed 5 years ago
@zBestData As a temporary workaround you can do this: add custom logger to your DI container (for instance, services.AddSingleton<ILogger, TempLogger>();
), where TempLogger can be:
internal sealed class TempLogger : ILogger
{
public IDisposable BeginScope<TState>(TState state)
{
return new NoopDisposable();
}
public bool IsEnabled(LogLevel logLevel)
{
return true;
}
public void Log<TState>(LogLevel logLevel, EventId eventId, TState state, Exception exception, Func<TState, Exception, string> formatter)
{
Console.WriteLine(formatter(state, exception));
}
private class NoopDisposable : IDisposable
{
public void Dispose()
{ }
}
}
@mkorsukov. Thanks! I've been working on it and with some modifications have been able to connect and pull the metadata from 5 or 6 different mls's. Now working those that require a UserAgentPassword and having dfficulty getting it to connect in the initial request.
@zBestData May I ask a couple of questions?
1. Do you know how to search for property in multiple classes (residential etc.)?
var searchRequest = new SearchRequest("PROPERTY", "RES");
searchRequest.Limit = 1;
searchRequest.ParameterGroup.AddParameter(new QueryParameter("MLNUMBER", mlsId));
I have tried different combinations (in "RES"
), but can't find the right one.
2. Do you use a similar pattern for searching by city?
if (!string.IsNullOrEmpty(city))
{
var cities = await _client.GetLookupValues("PROPERTY", "CITY");
var cityReference = cities.Get().FirstOrDefault(x => string.Equals(x.LongValue, city, StringComparison.OrdinalIgnoreCase))?.Value;
if (!string.IsNullOrEmpty(cityReference))
{
searchRequest.ParameterGroup.AddParameter(new QueryParameter("CITY", cityReference));
}
}
3. RetsConnector library updates
I'm not sure if this github repo is in active support. I can see a very old PR here, which is not updated or merged. At the same time I have (localy) lots of internal updates to this library:
Should we create a new library with all updates/improvements?
@mkorsukov My problem isn't searching the data, but LOGGING into the RETS Server so that I CAN search the data. Every MLS operates independantly, and there up to 4 different paramenters that can be required for access(UserName, UserPassword, UserAgent, UserAgentPassword). So far, I have been able to login and pull data from 8 different MLS's. There is only one left that I have not been able to connect to.
I have attached an updated copy of the project with my revisions. With some help, the ILogger issue has been fixed and I can now retrieve data when only the UserName and Password are requried. However, I can not login when the UserAgent and UserAgentPassword are also required. Not sure why. I have also added a pdf containing the Specs to version 1.8 of RETS.
If anyone would like to help, Email or PM me directly for login credentials of the MLS I am having difficulty with.
Thanks! RetsConnector-zBestData.zip
I have fixed several issues in regards to logging in an tried to submit a pull request, but it appears that I lack the needed permissions. The project should now connect to the MLS's regardless of Basic or Digest Authentication. As of this post, I am able to log into these MLS and Data Providers:
MLS - Data Provider
Happy Coding!
Graham
@zBestData Thank you for update! May I ask a question? The issues you found because of different MLS versions or different MLS implementations?
I will try to explain..... There are several different ways an mls may require you to login. Each MLS operates independently, so the requirements can vary from one mls to the next. In addition to just the user name and password, they may also require you to provide a userAgentName and UserAgentPassword, which adds another layer. Though TLS1.2 is supposed to be the current standard for RETS, some MLS may require a different encryptions. I can get confusing.
It's been a while since I worked on this project. However, I have apps that depend on it and are being used every day.
I just made some updates to fix the Loggin errors and improve a few other things. For the folks that want to contribute, please send is your pull request. Version 2.0.0 was just released.
I will download the update and take a look. I would love to see this evolve a bit more. Even though they are now starting to push MATRIX, I don't see RETS going away anytime soon, and the NAR's libRETS is no longer being supported as it once was.
@zBestData Thanks for your response. When I published this package, I did not realize people would be interested in using it. As previously mentioned, this library is used every day by a project of mine so I'll always support it (at least as much as my project requires it or if it gains lots of interest from the community)
Please share your feedback with me. Also, feel free to contribute via pull requests.
Thanks! Feel free to connect with me on LinkedIn as well.
We are pulling from multiple mls's and have had our hands were tied waiting for an update to libRETS. Would like to just move it all to .NET Core so to not have to worry about it. We are delivering MLS Data via a .Net Core Api to this Real Estate Platform https://zbestpropertymanager.com/
@zBestData Let me know when you convert to using .Net Core and this project. Let me know if you run into any issues. Also, when possible please contact me at mike@crestapps.com for a quick chat
I downloaded your project, added my info to the appsettings.json file and ran the application. When it hits this line, an error is thrown.
System.InvalidOperationException: 'Unable to resolve service for type 'Microsoft.Extensions.Logging.ILogger' while attempting to activate 'CrestApps.RetsSdk.Services.RetsSession'.'