Pusher dotnet api for .NET Web Api Core and WPF - pusher

I'm trying to integrate Pusher instead of SignalR into my .NET application. My application consists of .NET Core Web Api and WPF clients and they need to communicate via Web Sockets (besides obvious REST communication).
The thing is I'm confused which library I'm supposed to use. Like there's an official .NET library which is called pusher-http-dotnet. But its nuget package is called PusherServer which is very confusing. Is it supposed to work only as a server solution? Can I use it for WPF clients? Seems like not as I see a lot of Triggering examples and no Subscribing ones.
There's another library under Pusher-Community account which is called pusher-websocket-dotnet and its nuget package is published under name PusherClient. The good news it seems to have some subscribing api. The bad news is it has quite serious issues without any response.
I'm totally confused with Pusher .NET libraries.

Pusher libraries are split in to http libraries, for publishing events and authenticating private channels (usually running on a server); and websocket libraries, for subscribing to channels and binding to events (usually running on the client). See here for a comprehensive list. pusher-http-dotnet falls in to the former category, so doesn't provide subscribing functionality. pusher-websocket-dotnet is the websocket counterpart (with subscribing etc.) – it is a community library, and as a result development on it is slow and it is not as polished as the official libraries, but many people use it without issue.

Related

Has Node JS anything to offer for the UI?

Hope I'm not being to general but: I have been tasked with the job of "rejuvenating/modernizing" a monolithic Java EE (JSF/CDI/EJB/JPA) app. Since the requirements state that it should support multiple clients, I have split up the code in a server (JAX-RS interfaces) and a client part (not yet done)
The server is pretty straightforward but I'm wondering about the UI part. Nowadays (hope I don't sound too oldskool) various Node JS spin-offs seem to be popular but I'm under the impression that they have the most value to offer in the "scalable server" section. Does the various Angular/React/Node framework have anything to offer for the client if you have something more complex than a single page app?
It appears to be a really hard time to pick a UI technology nowadays. Sure, the server/DB part which contains most of the business logic are pretty future-proof but still, one would like to focus on one UI technology. There are various jQuery-based frameworks like Kendo, Vaadin & co etc. One option would be to stick with JSF + ICEfaces/PrimeFaces and just work with the REST interface. And then there is JavaFX which looks nice but the future looks a bit uncertain.
So. If the backend is not going to be Node JS, does Node JS have anything to offer for the UI part that can't be done more easily with other frameworks and does anyone have other insights on the UI layer in general. Predicting is hard, especially the future ;-)
Node.js is a way to run javascript on the server side, not client side. That said, npm (nodes package manager) or its wrappers (like bower) are quite often used to manage the client side dependencies - which is very useful to have.
Angular and react (among others) are client side javascript ui frameworks to help make writing ui much nicer. Neither depend on the backend being written in node.js and can work with any rest api (or other server side apis) - or no api at all if that backend injects all the data the page needs into the page itself.
Electron, which combines NodeJS and Chromium (render Process).
https://electronjs.org/
Formerly known as atom shell it was created by Github, it is the core of the Atom Editor, VS Code, Slack app, and a ton of “thick client” applications. https://en.m.wikipedia.org/wiki/Fat_client
There are several implementations which allow you to use Node.JS modules on a client-side (ie. web browser). You can then use html/css and call Node.JS modules directly from your DOM which is used to implement UI.
I'm most familiar with NW.js which I've used couple of times. Others would be for example Electron or AppJS

Missing Authentication Request/Response POCOs in ServiceStack Clients

After reading a lot about ServiceStack, I think it's such a beautiful work of art and I decided to use it for our upcoming Xamarin iOS App.
The problem currently is that after installing the ServiceStack.Client for Xamarin.iOS, I can't find the Request/Response DTOs (i.e POCOs) that are used for registration or authentication given that I have enabled the Authentication and Registration Plugins in the service host.
After digging into the source code, I found those Request/Response DTOs to reside in ServiceStack assembly which is a huge dependency and I don't think I can include it in our iOS App.
is there a way around that ? shouldn't these DTOs be shipped as well with the ServiceStack clients themselves under maybe ServiceStack.Client.Auth ?
Thanks
Sorry, I guess I found them already available inside ServiceStack.Client .. what confused me is that I took some sample code from the C# client wiki and the DTOs were named differently and not available .. Thanks –

What are the client expected dependencies when using the new ServiceStack design guidance?

Given the most awesome release of the Visual Studio Extension for ServiceStack, I wanted to make sure that after creating my service with ServiceStack, that when I create a client to consume said services that I'm doing it correctly. By that I mean in a loosely coupled, high performance way.
Let's say that we examine the EmailContacts project so we're all on the same page. The Email Contacts project has a reference to both the EmailContacts.ServiceInterface and EmailContacts.ServiceModel, this is understandable as this IS the service. Now I want to consume this service from another .NET project, doesn't matter what type, console or web.
So my question is this "In the consumer application, will I add a reference to EmailContacts.ServiceInterface and EmailContacts.ServiceModel and use the ServiceStack C# client library?", I don't see where I have a choice not too.
Thank you,
Stephen
Keep Service Models in their own Assembly
The benefit of having a well-defined Service Contract where your DTO's are maintained in their own separate impl-free project is that clients will only ever need to reference your Services DTO's to use with one of ServiceStack's C#'s Generic Service Client to call any Service.
Add ServiceStack Reference
Clients are also able to avoid referencing any of your Server dlls if they use ServiceStack's Add ServiceStack Reference feature which provides another way for clients to access your Web Services DTO's.
Clients shouldn't reference any Server implementation projects
It's a code-smell if you find clients needing any reference other than your Service Model and ServiceStack's client libraries, which is an indication that your Service Models aren't in their own dependency and impl-free .dll, which shouldn't depend on anything other than ServiceStack.Interfaces.dll.

SocketStream.js without client side how to?

I am interested in develop a rt module for my website with socketstream + node.js. I am only interested in do the server side in socketstream, not the client side. How can I access the socketstream from a normal php/html app, wich js i have to include ? I am mainly interested in rpc, pub/sub and authentication/session.
I would not recommend doing this, as it is unorthodox.
That said, I do recall that someone wanted to use an early version of SocketStream from within their application, which was built on the .net platform. It turned out that they got it to work by embedding the SocketStream app's web page inside of an iframe.
Check out to this framework:
http://www.socketstream.org/
Comes with a lot of examples and it's easy to use.

Monotouch consuming ASP.NET Web Api

I have a Monotouch project that today uses WCF Web Services to get data. Now I want to migrate it in order to start using ASP.NET Web Api Json.
Does anyone know how can I send a viewmodel data from a ASP.NET Web Api and then read it in monotouch?
Thanks for the help in advance.
I think you should read this Xamarin article.
In general, Web API is just standard HTTP passing either XML or JSON back and forth. There is not necessarily a client framework accessing it--you can consume it with raw HttpWebRequests or the equivalent in whichever programming language you are using.
Considering that, your options are:
Use an open-source library to do it (something like RestSharp)
Create the HttpWebRequest calls, and format the XML or JSON for the requests and responses yourself (you can use the .Net BCL to do this or other open source projects)
I tend to do the former, just because I like fine grained control of what is going on. #1 might be easier for you though.

Resources