manison / Loxone.NET

Connect to your Loxone Miniserver from .NET application.
MIT License
1 stars 8 forks source link

ArgumentException at LXHttpClinet when trying to open a connection #3

Closed mabiste closed 4 years ago

mabiste commented 4 years ago

Hello,

based on the console sample program from token-authentication branch I'm trying to open a connection to my local miniserver using a miniserver address like "http://192.168.1.100/".

But I get a ArgumentException, the message:

ArgumentException: Es sind nur HTTP- und HTTPS-Schemas zulässig. Parametername: value

The exception occurs at LXHttpClient#EnsureHttpClient(). Here is the (truncated call stack):

System.AggregateException HResult=0x80131500 Message=Mindestens ein Fehler ist aufgetreten. Source=Loxone.NET.Test StackTrace: at Loxone.NET.Test.Program.Main(String[] args)

This exception was originally thrown at this call stack: System.Net.Http.HttpClient.CheckBaseAddress(System.Uri, string) System.Net.Http.HttpClient.BaseAddress.set(System.Uri) Loxone.Client.Transport.LXHttpClient.EnsureHttpClient() in LXHttpClient.cs Loxone.Client.Transport.LXHttpClient.RequestCommandInternalAsync(string, Loxone.Client.CommandEncryption, System.Threading.CancellationToken) in LXHttpClient.cs System.Runtime.CompilerServices.TaskAwaiter.ThrowForNonSuccess(System.Threading.Tasks.Task) System.Runtime.CompilerServices.TaskAwaiter.HandleNonSuccessAndDebuggerNotification(System.Threading.Tasks.Task) System.Runtime.CompilerServices.ConfiguredTaskAwaitable.ConfiguredTaskAwaiter.GetResult() Loxone.Client.Transport.LXClient.RequestCommandAsync(string, Loxone.Client.CommandEncryption, Loxone.Client.Transport.LXClient.RequestCommandValidation, System.Threading.CancellationToken) in LXClient.cs System.Runtime.CompilerServices.TaskAwaiter.ThrowForNonSuccess(System.Threading.Tasks.Task) System.Runtime.CompilerServices.TaskAwaiter.HandleNonSuccessAndDebuggerNotification(System.Threading.Tasks.Task) ... [Call Stack Truncated] Inner Exception 1: ArgumentException: Es sind nur HTTP- und HTTPS-Schemas zulässig. Parametername: value

While debugged, I've seen a wrong base url scheme ('ws'), but it was correctly set before: Ashampoo_Snap_Samstag, 4  Januar 2020_18h59m21s_001_

Anyone here can help me? Thanks! Marco

manison commented 4 years ago

Now rebased into master.

mabiste commented 4 years ago

It's working now, thank you very much! :-)