How to call API SignalR service from MVC application? - asp.net-web-api2

How to call API SignalR service from MVC application?
client code : $.connection.hub.url = "http://localhost:PortNumber/signalr"

Related

when ASP.NET core web API app connecting call WCF service API, how to authenticate

I am developing a C# backend app using ASP.NET core web API application. Inside this API, I need to call some API(WCF SOAP service) from database. For this WCF service, we were provided pre-built .dll, so will not use adding service reference. When calling these WCF service, have to pass my windows credential to let WCF service know I am a qualified user before use the service. Now I am stuck on how I can pass my credential to this WCF. What is the right architecture to use.(Screen shot is showing some endpoint of the WCF service)
Adding some background info, In our react frontend, will call these ASP.NET core web API to get data back from WCF, and show it on frontend.
I am new to C# and .Net core. Please share some insight. Thanks a lot. Happy New Year!!!
I did the ASP.NET core web API part. but could not figure out the right way to authenticate when connecting to WCF API.

Mimic Azure App Service authorization locally in ASP.NET core app

I am using in-built authentication of Azure App service to authorize access to my ASP.NET core app - https://learn.microsoft.com/en-us/azure/app-service/overview-authentication-authorization . Is there a way to mimic what Azure App service does in my machine so that I can run the same integration test on my local endpoint and cloud endpoint.
Thanks in advance!
Without Azure App service , you can use ASP.NET Core OpenID Connect middleware to integrate Azure AD into an ASP.NET Core web app :
Code samples :
Integrating Azure AD into an ASP.NET Core web app
https://stackoverflow.com/a/54546245/5751404

How to connect asp net core MVC to another asp net core SignalR server

i have a Aspnet core web application ,
want to connect to asp net core signalR server that is in the another server
with different url , in controller .
You can use ASP.NET Core SignalR .NET Client.
This library lets you communicate with SignalR hubs from .NET apps.

Receive wcf Callback in Asp.net Core application

I am having a Duplex WCF Service hosted on console. This is tested and worked fine.
I want to consume this WCF service in Asp.net Core. I have done this using this https://medium.com/#narinkaew/using-wcf-soap-services-in-net-core-fb13180c4eda Consume WCF in Asp.net Core.
I am able to get response, but I am not getting any callback. Its just keep waiting.
I have uploaded the Code https://filebin.net/pf9eplqjncc0octj.
ClinicWcfService - is wcf Service Application
HospitalServiceHost - WCF Service Hosted on Console
ServiceEngineersDesk - is Asp.net Core Application.
Can someone tell me how to get a WCF callback in asp.net core application?
I have done this from my side.
Instead of creating instance of interface of the wcf service, create a instance of interface implementation.
Now this class exposes the event of the callback. Just subscribe to it
After a some struggle i was able to found out.

What's the login authentication solution for asp.net MVC application and web API service

I use ASP.net MVC technology in the UI layer and use the MVC web API technology in the service lay(Application layer) and the service layer will be deployed in a different server.
I have used the form authentication in UI lay,what's the login authentication solution for the service layer?
the MVC web API of service layer will be called the by the javascript of UI layer directly,the problem is that I cannot pass the username and password from javascript to web api service for logon authentication ,it's not security and cannot use cookie to determine whether the user is logon,as the web API service is deployed on another server,the cookie cannot cross domain.
Can you give me a solution? Many thanks.