How to access to Remoting SDK Server from .Net code in Blazor WebAssembly

I have created simple Blazor WebAssembly project under .Net 6.0
I have tested different client channels for access to Remoting SDK Server:
IpHttpClientChannel (.NET)
WinInetHttpClientChannel (.NET)
IpSuperHttpClientChannel (.NET)
WinInetSuperHttpClientChannel (.NET)

None of them work with different errors (Operation is not supported on this platform):

Is it possible to use any .NET Client Channel under Blazor WebAssembly?

I found Data Abstract and Blazor
looks like this example use JavaScript Client Channel Component


The example mentioned is Blazor Server-Side. The issue is that Blazor ServerSide and Blazor ClientSide are completely different platforms, despite similar name and exposed API.

Blazor ClientSide is a very limited platform with a crippling limitation: it is strictly one-threaded, at least in NET 6. So none of the existing client channels is expected to work on Blazor Client.

At this time the best available solution is to expose service methods via HttpAPI ( HttpAPI ). Please note that adding HttpAPI support to the server does not require any changes in the existing clients. It is just one additional endpoint added to an existing server that allows clients to communicate using Http + JSON

I was able to access RO SDK server after I added these options to its startup code:

server.NetworkServer.ServerChannel = new IpHttpServerChannel { SendCrossOriginHeader = true };
server.NetworkServer.ApiDispatcher = new HttpApiDispatcher { ApiHost = "http://localhost:8099" };

In other words I enabled CORS on the server channel (otherwise Blazor app won’t be able to fetch data).
Then I added HttpAPI dispatcher and configured its ApiHost property (it is the address of the server that should be used by clients to perform calls)

Then in a freshly created Blazor app I added a Connected Service and fetched OpenAPI description of the RO SDK server ( Blazor OpenApi Net 5.0 | swaggerClient - YouTube )

After that I was able to call the server using this sample code:

var client = new FirstClient(Http);
var result = await client.TestAsync(new Service1DoSomethingRequest{SomeValue = "Sample Value"});

Here FirstClient is the server client class generated by Visual Studio.

We are working on a RO SDK client support for Blazor Client, however due to the platform limitations this might take some time.