Uno: wasm System.IAsyncResult _result = base.BeginInvoke("Login", _args, callback, asyncState); Operation is not supported on this platform

Created on 25 Dec 2018  Â·  15Comments  Â·  Source: unoplatform/uno

I'm using wcf to connect to my server, it works on android, ios , uwp and wasm in a hosted (wpfHost) but not on a ubuntu server

the line that gives me the error is
System.IAsyncResult _result = base.BeginInvoke("Login", _args, callback, asyncState);

I'm submitting a...


Bug report (I searched for similar issues and did not find one)



Current behavior

it works on android, ios , uwp and wasm in a hosted (wpfHost) but not on a ubuntu server

Expected behavior

Minimal reproduction of the problem with instructions

Loaded: System.IO.Compression.FileSystem.dll
mono.js:1 Loaded: System.Runtime.dll
mono.js:1 Loaded: System.Resources.ResourceManager.dll
mono.js:1 Loaded: System.Diagnostics.Debug.dll
mono.js:1 Loaded: System.Collections.Concurrent.dll
mono.js:1 Loaded: System.Collections.dll
mono.js:1 Loaded: System.Globalization.dll
mono.js:1 Loaded: System.Linq.dll
mono.js:1 Loaded: System.Reflection.dll
mono.js:1 Loaded: System.Runtime.Extensions.dll
mono.js:1 Loaded: System.Threading.dll
mono.js:1 Loaded: Microsoft.Practices.ServiceLocation.dll
mono.js:1 Loaded: System.Reflection.Emit.Lightweight.dll
mono.js:1 Loaded: System.Reflection.Emit.ILGeneration.dll
mono.js:1 Loaded: Microsoft.Extensions.Logging.dll
mono.js:1 Loaded: Microsoft.Extensions.DependencyInjection.Abstractions.dll
mono.js:1 Loaded: System.ComponentModel.dll
mono.js:1 Loaded: System.Linq.Expressions.dll
mono.js:1 Loaded: System.Threading.Tasks.dll
mono.js:1 Loaded: System.Numerics.Vectors.dll
mono.js:1 Loaded: System.ServiceModel.Http.dll
mono.js:1 Loaded: System.IdentityModel.dll
mono.js:1 Loaded: System.ServiceModel.Primitives.dll
mono.js:1 Loaded: Microsoft.Extensions.Logging.Filter.dll
mono.js:1 Loaded: Microsoft.Extensions.Primitives.dll
mono.js:1 Loaded: System.Runtime.CompilerServices.Unsafe.dll
mono.js:1 Loaded: Microsoft.Extensions.Logging.Console.dll
mono.js:1 Loaded: Microsoft.Extensions.Configuration.Abstractions.dll
mono.js:1 Loaded: System.Console.dll
mono.js:1 Loaded: System.Runtime.InteropServices.RuntimeInformation.dll
mono.js:1 Loaded: System.IO.dll
mono.js:1 Loaded: WebAssembly.Bindings.dll
mono.js:1 Loaded: System.Transactions.dll
mono.js:1 Loaded: netstandard.dll
mono.js:1 Loaded: Microsoft.Extensions.Logging.Abstractions.dll
mono.js:1 Loaded: System.Drawing.dll
mono.js:1 Loaded: Uno.Foundation.dll
mono.js:1 Loaded: System.Numerics.dll
mono.js:1 Loaded: System.IO.Compression.dll
mono.js:1 Loaded: System.Net.Http.dll
mono.js:1 Loaded: System.Xml.Linq.dll
mono.js:1 Loaded: System.ServiceModel.Internals.dll
mono.js:1 Loaded: System.Web.Services.dll
mono.js:1 Loaded: Uno.Xaml.dll
mono.js:1 Loaded: Uno.UI.Wasm.dll
mono.js:1 Loaded: System.ComponentModel.Composition.dll
mono.js:1 Loaded: System.Collections.Immutable.dll
mono.js:1 Loaded: Mono.Security.dll
mono.js:1 Loaded: Microsoft.CSharp.dll
mono.js:1 Loaded: Uno.Core.dll
mono.js:1 Loaded: System.ServiceModel.dll
mono.js:1 Loaded: MySaaSPlace.Wasm.dll
mono.js:1 Loaded: System.Runtime.Serialization.dll
mono.js:1 Loaded: System.Core.dll
mono.js:1 Loaded: System.dll
mono.js:1 Loaded: System.Data.dll
mono.js:1 Loaded: System.Xml.dll
mono.js:1 Loaded: Uno.UI.dll
mono.js:1 Loaded: mscorlib.dll
mono.js:1 Loaded: Uno.dll
mono.js:1 initializing mono runtime
mono.js:1 >>mono_wasm_runtime_ready
require.js:5 [Violation] 'load' handler took 468ms
mono.js:1 launched!
mono.js:1 The type [System.Object] is not known by the MetadataProvider, either add the Bindable attribute or add it to the TypeMetadataConfig.xml
mono.js:1 GC_MINOR: (Nursery full) time 15.20ms, stw 15.20ms promoted 2806K major size: 3824K in use: 3158K los size: 1024K in use: 40K
mono.js:1 [Violation] 'setTimeout' handler took 1486ms
mono.js:1 [Violation] 'setTimeout' handler took 179ms
mono.js:1 des2
mono.js:1 des3
mono.js:1 prueba
mono.js:1 111BeginLogin
mono.js:1 System.AsyncCallback
mono.js:1 
put_char @ mono.js:1
write @ mono.js:1
write @ mono.js:1
doWritev @ mono.js:1

I have add the full log file

Environment

UBUNTU on win10
```
Nuget Package:
Uno.UI 581
Uno,wasmBootstramp 131
Uno.Wasm.MonoRuntime 131
localhost-1545698192258.log

Package Version(s):

Affected platform(s):

  • [ ] iOS
  • [ ] Android
  • [X ] WebAssembly
  • [ ] Windows
  • [ ] Build tasks

Visual Studio

  • [ ] 2017 (version: 15.9.3 )
  • [ ] 2017 Preview (version: )
  • [ ] for Mac (version: )
kinbug

All 15 comments

Thanks for the report! You're probably trying to use the default HttpClient, which does not work by default under Wasm yet. You may want to adjust your network calls using the Uno WasmHttpHandler.

HI need your help

I dont find where to var handler = new Wasm.WasmHttpHandler()

this is my code :
Services.AspLogin.AuthenticationServiceClient authService = new Services.AspLogin.AuthenticationServiceClient();
authService.LoginCompleted += new EventHandler(authService_LoginCompleted);

                          authService.LoginAsync("xxxx", "xxxx", "", true);

====
using System;
using System.Collections.Generic;
using System.Text;

namespace MySaaSPlace.Services.AspLogin
{

[System.CodeDom.Compiler.GeneratedCodeAttribute("System.ServiceModel", "4.0.0.0")]
[System.ServiceModel.ServiceContractAttribute(Namespace = "http://asp.net/ApplicationServices/v200", ConfigurationName = "AspLogin.AuthenticationService")]
public interface AuthenticationService
{

    [System.ServiceModel.OperationContractAttribute(AsyncPattern = true, Action = "http://asp.net/ApplicationServices/v200/AuthenticationService/ValidateUser", ReplyAction = "http://asp.net/ApplicationServices/v200/AuthenticationService/ValidateUserRespons" +
        "e")]
    System.IAsyncResult BeginValidateUser(string username, string password, string customCredential, System.AsyncCallback callback, object asyncState);

    bool EndValidateUser(System.IAsyncResult result);

    [System.ServiceModel.OperationContractAttribute(AsyncPattern = true, Action = "http://asp.net/ApplicationServices/v200/AuthenticationService/Login", ReplyAction = "http://asp.net/ApplicationServices/v200/AuthenticationService/LoginResponse")]
    System.IAsyncResult BeginLogin(string username, string password, string customCredential, bool isPersistent, System.AsyncCallback callback, object asyncState);

    bool EndLogin(System.IAsyncResult result);

    [System.ServiceModel.OperationContractAttribute(AsyncPattern = true, Action = "http://asp.net/ApplicationServices/v200/AuthenticationService/IsLoggedIn", ReplyAction = "http://asp.net/ApplicationServices/v200/AuthenticationService/IsLoggedInResponse")]
    System.IAsyncResult BeginIsLoggedIn(System.AsyncCallback callback, object asyncState);

    bool EndIsLoggedIn(System.IAsyncResult result);

    [System.ServiceModel.OperationContractAttribute(AsyncPattern = true, Action = "http://asp.net/ApplicationServices/v200/AuthenticationService/Logout", ReplyAction = "http://asp.net/ApplicationServices/v200/AuthenticationService/LogoutResponse")]
    System.IAsyncResult BeginLogout(System.AsyncCallback callback, object asyncState);

    void EndLogout(System.IAsyncResult result);
}

[System.CodeDom.Compiler.GeneratedCodeAttribute("System.ServiceModel", "4.0.0.0")]
public interface AuthenticationServiceChannel : MySaaSPlace.Services.AspLogin.AuthenticationService, System.ServiceModel.IClientChannel
{
}

[System.Diagnostics.DebuggerStepThroughAttribute()]
[System.CodeDom.Compiler.GeneratedCodeAttribute("System.ServiceModel", "4.0.0.0")]
public partial class ValidateUserCompletedEventArgs : System.ComponentModel.AsyncCompletedEventArgs
{

    private object[] results;

    public ValidateUserCompletedEventArgs(object[] results, System.Exception exception, bool cancelled, object userState) :
            base(exception, cancelled, userState)
    {
        this.results = results;
    }

    public bool Result
    {
        get
        {
            base.RaiseExceptionIfNecessary();
            return ((bool)(this.results[0]));
        }
    }
}

[System.Diagnostics.DebuggerStepThroughAttribute()]
[System.CodeDom.Compiler.GeneratedCodeAttribute("System.ServiceModel", "4.0.0.0")]
public partial class LoginCompletedEventArgs : System.ComponentModel.AsyncCompletedEventArgs
{

    private object[] results;

    public LoginCompletedEventArgs(object[] results, System.Exception exception, bool cancelled, object userState) :
            base(exception, cancelled, userState)
    {
        this.results = results;
    }

    public bool Result
    {
        get
        {
            base.RaiseExceptionIfNecessary();
            return ((bool)(this.results[0]));
        }
    }
}

[System.Diagnostics.DebuggerStepThroughAttribute()]
[System.CodeDom.Compiler.GeneratedCodeAttribute("System.ServiceModel", "4.0.0.0")]
public partial class IsLoggedInCompletedEventArgs : System.ComponentModel.AsyncCompletedEventArgs
{

    private object[] results;

    public IsLoggedInCompletedEventArgs(object[] results, System.Exception exception, bool cancelled, object userState) :
            base(exception, cancelled, userState)
    {
        this.results = results;
    }

    public bool Result
    {
        get
        {
            base.RaiseExceptionIfNecessary();
            return ((bool)(this.results[0]));
        }
    }
}

[System.Diagnostics.DebuggerStepThroughAttribute()]
[System.CodeDom.Compiler.GeneratedCodeAttribute("System.ServiceModel", "4.0.0.0")]
public partial class AuthenticationServiceClient : System.ServiceModel.ClientBase<MySaaSPlace.Services.AspLogin.AuthenticationService>, MySaaSPlace.Services.AspLogin.AuthenticationService
{

    private BeginOperationDelegate onBeginValidateUserDelegate;

    private EndOperationDelegate onEndValidateUserDelegate;

    private System.Threading.SendOrPostCallback onValidateUserCompletedDelegate;

    private BeginOperationDelegate onBeginLoginDelegate;

    private EndOperationDelegate onEndLoginDelegate;

    private System.Threading.SendOrPostCallback onLoginCompletedDelegate;

    private BeginOperationDelegate onBeginIsLoggedInDelegate;

    private EndOperationDelegate onEndIsLoggedInDelegate;

    private System.Threading.SendOrPostCallback onIsLoggedInCompletedDelegate;

    private BeginOperationDelegate onBeginLogoutDelegate;

    private EndOperationDelegate onEndLogoutDelegate;

    private System.Threading.SendOrPostCallback onLogoutCompletedDelegate;

    private BeginOperationDelegate onBeginOpenDelegate;

    private EndOperationDelegate onEndOpenDelegate;

    private System.Threading.SendOrPostCallback onOpenCompletedDelegate;

    private BeginOperationDelegate onBeginCloseDelegate;

    private EndOperationDelegate onEndCloseDelegate;

    private System.Threading.SendOrPostCallback onCloseCompletedDelegate;
    //Iosu NUEVO

    public AuthenticationServiceClient() :
            base(MySaaSPlace.Services.LoginHelper.GetDefaultBinding(), MySaaSPlace.Services.LoginHelper.GetDefaultEndpointAddress("https://azure.mysaasplace.com/Authentication.svc"))
    {
        this.Endpoint.Name = EndpointConfiguration.BasicHttpBinding_AuthenticationService.ToString();
        ConfigureEndpoint(this.Endpoint, this.ClientCredentials);
    }
    static partial void ConfigureEndpoint(System.ServiceModel.Description.ServiceEndpoint serviceEndpoint, System.ServiceModel.Description.ClientCredentials clientCredentials);
    public enum EndpointConfiguration
    {

        BasicHttpBinding_AuthenticationService,
    }

    //public AuthenticationServiceClient() :
    //       base(AuthenticationServiceClient.GetDefaultBinding(), AuthenticationServiceClient.GetDefaultEndpointAddress())
    //{
    //    this.Endpoint.Name = EndpointConfiguration.BasicHttpBinding_AuthenticationService.ToString();
    //    ConfigureEndpoint(this.Endpoint, this.ClientCredentials);
    //}

    //private static System.ServiceModel.Channels.Binding GetBindingForEndpoint(EndpointConfiguration endpointConfiguration)
    //{
    //    if ((endpointConfiguration == EndpointConfiguration.BasicHttpBinding_AuthenticationService))
    //    {
    //        System.ServiceModel.BasicHttpBinding result = new System.ServiceModel.BasicHttpBinding();
    //        result.MaxBufferSize = int.MaxValue;
    //        result.ReaderQuotas = System.Xml.XmlDictionaryReaderQuotas.Max;
    //        result.MaxReceivedMessageSize = int.MaxValue;
    //        result.AllowCookies = true;
    //        result.Security.Mode = System.ServiceModel.BasicHttpSecurityMode.Transport;
    //        return result;
    //    }
    //    throw new System.InvalidOperationException(string.Format("Could not find endpoint with name \'{0}\'.", endpointConfiguration));
    //}

    //private static System.ServiceModel.EndpointAddress GetDefaultEndpointAddress()
    //{
    //    return AuthenticationServiceClient.GetEndpointAddress(EndpointConfiguration.BasicHttpBinding_AuthenticationService);
    //}

    //private static System.ServiceModel.Channels.Binding GetDefaultBinding()
    //{
    //    return AuthenticationServiceClient.GetBindingForEndpoint(EndpointConfiguration.BasicHttpBinding_AuthenticationService);
    //}
    //private static System.ServiceModel.EndpointAddress GetEndpointAddress(EndpointConfiguration endpointConfiguration)
    //{
    //    if ((endpointConfiguration == EndpointConfiguration.BasicHttpBinding_AuthenticationService))
    //    {
    //        //("https://azure3.mysaasplace.com/Authentication.svc"); //
    //        return new System.ServiceModel.EndpointAddress("https://azure.mysaasplace.com/Authentication.svc"); //
    //    }
    //    throw new System.InvalidOperationException(string.Format("Could not find endpoint with name \'{0}\'.", endpointConfiguration));
    //}
    //FIN IOSU
    public AuthenticationServiceClient(string endpointConfigurationName) :
            base(endpointConfigurationName)
    {
    }

    public AuthenticationServiceClient(string endpointConfigurationName, string remoteAddress) :
            base(endpointConfigurationName, remoteAddress)
    {
    }

    public AuthenticationServiceClient(string endpointConfigurationName, System.ServiceModel.EndpointAddress remoteAddress) :
            base(endpointConfigurationName, remoteAddress)
    {
    }

    public AuthenticationServiceClient(System.ServiceModel.Channels.Binding binding, System.ServiceModel.EndpointAddress remoteAddress) :
            base(binding, remoteAddress)
    {
    }

    public System.Net.CookieContainer CookieContainer
    {
        get
        {
            System.ServiceModel.Channels.IHttpCookieContainerManager httpCookieContainerManager = this.InnerChannel.GetProperty<System.ServiceModel.Channels.IHttpCookieContainerManager>();
            if ((httpCookieContainerManager != null))
            {
                return httpCookieContainerManager.CookieContainer;
            }
            else
            {
                return null;
            }
        }
        set
        {
            System.ServiceModel.Channels.IHttpCookieContainerManager httpCookieContainerManager = this.InnerChannel.GetProperty<System.ServiceModel.Channels.IHttpCookieContainerManager>();
            if ((httpCookieContainerManager != null))
            {
                httpCookieContainerManager.CookieContainer = value;
            }
            else
            {
                throw new System.InvalidOperationException("Unable to set the CookieContainer. Please make sure the binding contains an HttpC" +
                        "ookieContainerBindingElement.");
            }
        }
    }

    public event System.EventHandler<ValidateUserCompletedEventArgs> ValidateUserCompleted;

    public event System.EventHandler<LoginCompletedEventArgs> LoginCompleted;

    public event System.EventHandler<IsLoggedInCompletedEventArgs> IsLoggedInCompleted;

    public event System.EventHandler<System.ComponentModel.AsyncCompletedEventArgs> LogoutCompleted;

    public event System.EventHandler<System.ComponentModel.AsyncCompletedEventArgs> OpenCompleted;

    public event System.EventHandler<System.ComponentModel.AsyncCompletedEventArgs> CloseCompleted;

    [System.ComponentModel.EditorBrowsableAttribute(System.ComponentModel.EditorBrowsableState.Advanced)]
    System.IAsyncResult MySaaSPlace.Services.AspLogin.AuthenticationService.BeginValidateUser(string username, string password, string customCredential, System.AsyncCallback callback, object asyncState)
    {
        return base.Channel.BeginValidateUser(username, password, customCredential, callback, asyncState);
    }

    [System.ComponentModel.EditorBrowsableAttribute(System.ComponentModel.EditorBrowsableState.Advanced)]
    bool MySaaSPlace.Services.AspLogin.AuthenticationService.EndValidateUser(System.IAsyncResult result)
    {
        return base.Channel.EndValidateUser(result);
    }

    private System.IAsyncResult OnBeginValidateUser(object[] inValues, System.AsyncCallback callback, object asyncState)
    {
        string username = ((string)(inValues[0]));
        string password = ((string)(inValues[1]));
        string customCredential = ((string)(inValues[2]));
        return ((MySaaSPlace.Services.AspLogin.AuthenticationService)(this)).BeginValidateUser(username, password, customCredential, callback, asyncState);
    }

    private object[] OnEndValidateUser(System.IAsyncResult result)
    {
        bool retVal = ((MySaaSPlace.Services.AspLogin.AuthenticationService)(this)).EndValidateUser(result);
        return new object[] {
                retVal};
    }

    private void OnValidateUserCompleted(object state)
    {
        if ((this.ValidateUserCompleted != null))
        {
            InvokeAsyncCompletedEventArgs e = ((InvokeAsyncCompletedEventArgs)(state));
            this.ValidateUserCompleted(this, new ValidateUserCompletedEventArgs(e.Results, e.Error, e.Cancelled, e.UserState));
        }
    }

    public void ValidateUserAsync(string username, string password, string customCredential)
    {
        this.ValidateUserAsync(username, password, customCredential, null);
    }

    public void ValidateUserAsync(string username, string password, string customCredential, object userState)
    {
        if ((this.onBeginValidateUserDelegate == null))
        {
            this.onBeginValidateUserDelegate = new BeginOperationDelegate(this.OnBeginValidateUser);
        }
        if ((this.onEndValidateUserDelegate == null))
        {
            this.onEndValidateUserDelegate = new EndOperationDelegate(this.OnEndValidateUser);
        }
        if ((this.onValidateUserCompletedDelegate == null))
        {
            this.onValidateUserCompletedDelegate = new System.Threading.SendOrPostCallback(this.OnValidateUserCompleted);
        }
        base.InvokeAsync(this.onBeginValidateUserDelegate, new object[] {
                    username,
                    password,
                    customCredential}, this.onEndValidateUserDelegate, this.onValidateUserCompletedDelegate, userState);
    }

    [System.ComponentModel.EditorBrowsableAttribute(System.ComponentModel.EditorBrowsableState.Advanced)]
    System.IAsyncResult MySaaSPlace.Services.AspLogin.AuthenticationService.BeginLogin(string username, string password, string customCredential, bool isPersistent, System.AsyncCallback callback, object asyncState)
    {

        return base.Channel.BeginLogin(username, password, customCredential, isPersistent, callback, asyncState);
    }

    [System.ComponentModel.EditorBrowsableAttribute(System.ComponentModel.EditorBrowsableState.Advanced)]
    bool MySaaSPlace.Services.AspLogin.AuthenticationService.EndLogin(System.IAsyncResult result)
    {
        return base.Channel.EndLogin(result);
    }

    private System.IAsyncResult OnBeginLogin(object[] inValues, System.AsyncCallback callback, object asyncState)
    {
        string username = ((string)(inValues[0]));
        string password = ((string)(inValues[1]));
        string customCredential = ((string)(inValues[2]));
        bool isPersistent = ((bool)(inValues[3]));
        return ((MySaaSPlace.Services.AspLogin.AuthenticationService)(this)).BeginLogin(username, password, customCredential, isPersistent, callback, asyncState);
    }

    private object[] OnEndLogin(System.IAsyncResult result)
    {
        Console.WriteLine("OnEndLogin");
        bool retVal = ((MySaaSPlace.Services.AspLogin.AuthenticationService)(this)).EndLogin(result);
        return new object[] {
                retVal};
    }

    private void OnLoginCompleted(object state)
    {
        if ((this.LoginCompleted != null))
        {
            InvokeAsyncCompletedEventArgs e = ((InvokeAsyncCompletedEventArgs)(state));
            Console.WriteLine("OnLoginCompleted");
            this.LoginCompleted(this, new LoginCompletedEventArgs(e.Results, e.Error, e.Cancelled, e.UserState));
        }
    }

    public void LoginAsync(string username, string password, string customCredential, bool isPersistent)
    {
        this.LoginAsync(username, password, customCredential, isPersistent, null);
    }

    public void LoginAsync(string username, string password, string customCredential, bool isPersistent, object userState)
    {

        if ((this.onBeginLoginDelegate == null))
        {
            this.onBeginLoginDelegate = new BeginOperationDelegate(this.OnBeginLogin);
        }
        if ((this.onEndLoginDelegate == null))
        {
            this.onEndLoginDelegate = new EndOperationDelegate(this.OnEndLogin);
        }
        if ((this.onLoginCompletedDelegate == null))
        {
            this.onLoginCompletedDelegate = new System.Threading.SendOrPostCallback(this.OnLoginCompleted);
        }
        base.InvokeAsync(this.onBeginLoginDelegate, new object[] {
                    username,
                    password,
                    customCredential,
                    isPersistent}, this.onEndLoginDelegate, this.onLoginCompletedDelegate, userState);
    }

    [System.ComponentModel.EditorBrowsableAttribute(System.ComponentModel.EditorBrowsableState.Advanced)]
    System.IAsyncResult MySaaSPlace.Services.AspLogin.AuthenticationService.BeginIsLoggedIn(System.AsyncCallback callback, object asyncState)
    {
        return base.Channel.BeginIsLoggedIn(callback, asyncState);
    }

    [System.ComponentModel.EditorBrowsableAttribute(System.ComponentModel.EditorBrowsableState.Advanced)]
    bool MySaaSPlace.Services.AspLogin.AuthenticationService.EndIsLoggedIn(System.IAsyncResult result)
    {
        return base.Channel.EndIsLoggedIn(result);
    }

    private System.IAsyncResult OnBeginIsLoggedIn(object[] inValues, System.AsyncCallback callback, object asyncState)
    {
        return ((MySaaSPlace.Services.AspLogin.AuthenticationService)(this)).BeginIsLoggedIn(callback, asyncState);
    }

    private object[] OnEndIsLoggedIn(System.IAsyncResult result)
    {
        bool retVal = ((MySaaSPlace.Services.AspLogin.AuthenticationService)(this)).EndIsLoggedIn(result);
        return new object[] {
                retVal};
    }

    private void OnIsLoggedInCompleted(object state)
    {
        if ((this.IsLoggedInCompleted != null))
        {
            InvokeAsyncCompletedEventArgs e = ((InvokeAsyncCompletedEventArgs)(state));
            this.IsLoggedInCompleted(this, new IsLoggedInCompletedEventArgs(e.Results, e.Error, e.Cancelled, e.UserState));
        }
    }

    public void IsLoggedInAsync()
    {
        this.IsLoggedInAsync(null);
    }

    public void IsLoggedInAsync(object userState)
    {
        if ((this.onBeginIsLoggedInDelegate == null))
        {
            this.onBeginIsLoggedInDelegate = new BeginOperationDelegate(this.OnBeginIsLoggedIn);
        }
        if ((this.onEndIsLoggedInDelegate == null))
        {
            this.onEndIsLoggedInDelegate = new EndOperationDelegate(this.OnEndIsLoggedIn);
        }
        if ((this.onIsLoggedInCompletedDelegate == null))
        {
            this.onIsLoggedInCompletedDelegate = new System.Threading.SendOrPostCallback(this.OnIsLoggedInCompleted);
        }
        base.InvokeAsync(this.onBeginIsLoggedInDelegate, null, this.onEndIsLoggedInDelegate, this.onIsLoggedInCompletedDelegate, userState);
    }

    [System.ComponentModel.EditorBrowsableAttribute(System.ComponentModel.EditorBrowsableState.Advanced)]
    System.IAsyncResult MySaaSPlace.Services.AspLogin.AuthenticationService.BeginLogout(System.AsyncCallback callback, object asyncState)
    {
        return base.Channel.BeginLogout(callback, asyncState);
    }

    [System.ComponentModel.EditorBrowsableAttribute(System.ComponentModel.EditorBrowsableState.Advanced)]
    void MySaaSPlace.Services.AspLogin.AuthenticationService.EndLogout(System.IAsyncResult result)
    {
        base.Channel.EndLogout(result);
    }

    private System.IAsyncResult OnBeginLogout(object[] inValues, System.AsyncCallback callback, object asyncState)
    {
        return ((MySaaSPlace.Services.AspLogin.AuthenticationService)(this)).BeginLogout(callback, asyncState);
    }

    private object[] OnEndLogout(System.IAsyncResult result)
    {
        ((MySaaSPlace.Services.AspLogin.AuthenticationService)(this)).EndLogout(result);
        return null;
    }

    private void OnLogoutCompleted(object state)
    {
        if ((this.LogoutCompleted != null))
        {
            InvokeAsyncCompletedEventArgs e = ((InvokeAsyncCompletedEventArgs)(state));
            this.LogoutCompleted(this, new System.ComponentModel.AsyncCompletedEventArgs(e.Error, e.Cancelled, e.UserState));
        }
    }

    public void LogoutAsync()
    {
        this.LogoutAsync(null);
    }

    public void LogoutAsync(object userState)
    {
        if ((this.onBeginLogoutDelegate == null))
        {
            this.onBeginLogoutDelegate = new BeginOperationDelegate(this.OnBeginLogout);
        }
        if ((this.onEndLogoutDelegate == null))
        {
            this.onEndLogoutDelegate = new EndOperationDelegate(this.OnEndLogout);
        }
        if ((this.onLogoutCompletedDelegate == null))
        {
            this.onLogoutCompletedDelegate = new System.Threading.SendOrPostCallback(this.OnLogoutCompleted);
        }
        base.InvokeAsync(this.onBeginLogoutDelegate, null, this.onEndLogoutDelegate, this.onLogoutCompletedDelegate, userState);
    }

    private System.IAsyncResult OnBeginOpen(object[] inValues, System.AsyncCallback callback, object asyncState)
    {
        return ((System.ServiceModel.ICommunicationObject)(this)).BeginOpen(callback, asyncState);
    }

    private object[] OnEndOpen(System.IAsyncResult result)
    {
        ((System.ServiceModel.ICommunicationObject)(this)).EndOpen(result);
        return null;
    }

    private void OnOpenCompleted(object state)
    {
        if ((this.OpenCompleted != null))
        {
            InvokeAsyncCompletedEventArgs e = ((InvokeAsyncCompletedEventArgs)(state));
            this.OpenCompleted(this, new System.ComponentModel.AsyncCompletedEventArgs(e.Error, e.Cancelled, e.UserState));
        }
    }

    public void OpenAsync()
    {
        this.OpenAsync(null);
    }

    public void OpenAsync(object userState)
    {
        if ((this.onBeginOpenDelegate == null))
        {
            this.onBeginOpenDelegate = new BeginOperationDelegate(this.OnBeginOpen);
        }
        if ((this.onEndOpenDelegate == null))
        {
            this.onEndOpenDelegate = new EndOperationDelegate(this.OnEndOpen);
        }
        if ((this.onOpenCompletedDelegate == null))
        {
            this.onOpenCompletedDelegate = new System.Threading.SendOrPostCallback(this.OnOpenCompleted);
        }
        base.InvokeAsync(this.onBeginOpenDelegate, null, this.onEndOpenDelegate, this.onOpenCompletedDelegate, userState);
    }

    private System.IAsyncResult OnBeginClose(object[] inValues, System.AsyncCallback callback, object asyncState)
    {
        return ((System.ServiceModel.ICommunicationObject)(this)).BeginClose(callback, asyncState);
    }

    private object[] OnEndClose(System.IAsyncResult result)
    {
        ((System.ServiceModel.ICommunicationObject)(this)).EndClose(result);
        return null;
    }

    private void OnCloseCompleted(object state)
    {
        if ((this.CloseCompleted != null))
        {
            InvokeAsyncCompletedEventArgs e = ((InvokeAsyncCompletedEventArgs)(state));
            this.CloseCompleted(this, new System.ComponentModel.AsyncCompletedEventArgs(e.Error, e.Cancelled, e.UserState));
        }
    }

    public void CloseAsync()
    {
        this.CloseAsync(null);
    }

    public void CloseAsync(object userState)
    {
        if ((this.onBeginCloseDelegate == null))
        {
            this.onBeginCloseDelegate = new BeginOperationDelegate(this.OnBeginClose);
        }
        if ((this.onEndCloseDelegate == null))
        {
            this.onEndCloseDelegate = new EndOperationDelegate(this.OnEndClose);
        }
        if ((this.onCloseCompletedDelegate == null))
        {
            this.onCloseCompletedDelegate = new System.Threading.SendOrPostCallback(this.OnCloseCompleted);
        }
        base.InvokeAsync(this.onBeginCloseDelegate, null, this.onEndCloseDelegate, this.onCloseCompletedDelegate, userState);
    }

    protected override MySaaSPlace.Services.AspLogin.AuthenticationService CreateChannel()
    {
        return new AuthenticationServiceClientChannel(this);
    }

    private class AuthenticationServiceClientChannel : ChannelBase<MySaaSPlace.Services.AspLogin.AuthenticationService>, MySaaSPlace.Services.AspLogin.AuthenticationService
    {

        public AuthenticationServiceClientChannel(System.ServiceModel.ClientBase<MySaaSPlace.Services.AspLogin.AuthenticationService> client) :
                base(client)
        {
        }

        public System.IAsyncResult BeginValidateUser(string username, string password, string customCredential, System.AsyncCallback callback, object asyncState)
        {
            object[] _args = new object[3];
            _args[0] = username;
            _args[1] = password;
            _args[2] = customCredential;
            System.IAsyncResult _result = base.BeginInvoke("ValidateUser", _args, callback, asyncState);
            return _result;
        }

        public bool EndValidateUser(System.IAsyncResult result)
        {
            object[] _args = new object[0];
            bool _result = ((bool)(base.EndInvoke("ValidateUser", _args, result)));
            return _result;
        }

        public System.IAsyncResult BeginLogin(string username, string password, string customCredential, bool isPersistent, System.AsyncCallback callback, object asyncState)
        {


            object[] _args = new object[4];
            _args[0] = username;
            _args[1] = password;
            _args[2] = customCredential;
            _args[3] = isPersistent;
            Console.WriteLine("111BeginLogin");
            Console.WriteLine(callback.ToString());
            System.IAsyncResult _result = base.BeginInvoke("Login", _args, callback, asyncState);
            Console.WriteLine("Termina BeginLogin ");
            return _result;
        }

        public bool EndLogin(System.IAsyncResult result)
        {
            object[] _args = new object[0];
            bool _result = ((bool)(base.EndInvoke("Login", _args, result)));
            Console.WriteLine("EndLogin");
            return _result;
        }

        public System.IAsyncResult BeginIsLoggedIn(System.AsyncCallback callback, object asyncState)
        {
            object[] _args = new object[0];
            System.IAsyncResult _result = base.BeginInvoke("IsLoggedIn", _args, callback, asyncState);
            Console.WriteLine("BeginIsLoggedIn");
            return _result;
        }

        public bool EndIsLoggedIn(System.IAsyncResult result)
        {
            object[] _args = new object[0];
            bool _result = ((bool)(base.EndInvoke("IsLoggedIn", _args, result)));
            Console.WriteLine("EndIsLoggedIn");
            return _result;
        }

        public System.IAsyncResult BeginLogout(System.AsyncCallback callback, object asyncState)
        {
            object[] _args = new object[0];
            System.IAsyncResult _result = base.BeginInvoke("Logout", _args, callback, asyncState);
            return _result;
        }

        public void EndLogout(System.IAsyncResult result)
        {
            object[] _args = new object[0];
            base.EndInvoke("Logout", _args, result);
        }
    }
}

}

Hi

I have been searching how to replace the defauld handler , but I can't find a solution
Can you please help me ?

Thanks

In this case, you can use https://github.com/nventive/Uno/issues/161 to change the default handler globally.

I have already try it

I run it in a button_click event and I get null result on httpMessageHandler

var httpMessageHandler = Type
.GetType("System.Net.Http.HttpClient, System.Net.Http")
.GetField(
"GetHttpMessageHandler",
BindingFlags.Static | BindingFlags.NonPublic
);

Believe me I have spend hours on this..

Any more ideas ?

Thanks

Which version of the Uno.UI nuget package are you using ?

I have try with many of them.

But this particular issue if a remember correctly with .581 or 587

This looks like a linking issue. Could you add <assembly fullname="System.Net.Http" /> in your LinkerConfig.xml file ? Try updating the Uno.Wasm.Bootstrap to the latest pre-release as well.

Ok , I will try.

BTW calling https://github.com/nventive/Uno/issues/161
On app.xaml.cs on initialization it's enough To setup globally ?

Yes, as long as there are no network calls before that.

Ok, I will try and report back

Thank you!

BTW..

Why don't you add this hack on the wasm solution as default ?

Because the default httpcliet handler is incompatible with wasm..

Just an idea

Thanks again

We thought about it, but mono is getting proper support for it soon. We might need to reevaluate that, btw.

I don't know how much time is to implement this by default .. but I vote to implement it ASAP.. because I don't know how soon is mono going to implement it but this is the type of issue that takes long time to catch and fix by our one the users..

Hi
I have found the issue, I have reported on
https://github.com/nventive/Uno/issues/526

Was this page helpful?
0 / 5 - 0 ratings

Related issues

peternary picture peternary  Â·  3Comments

MartinZikmund picture MartinZikmund  Â·  4Comments

MartinZikmund picture MartinZikmund  Â·  3Comments

JanabiSoft picture JanabiSoft  Â·  4Comments

bricelam picture bricelam  Â·  3Comments