Answered by:
Send API events using Signalr

Question
-
User1806771833 posted
I have a API which only send events from IntegrationServer-server to DotNetApi objects, that live on server-side app. I am developing an client application where I would like to use SignalR which is used to send the events from server-side-app (using SignalR library ) to browser (using SignalR jQuery library). In my client application I have below event :<o:p></o:p>
<o:p> </o:p> agent.IncomingSessionEvent += new ISEventHandler<IAgent, IncomingSessionEvent>(IncomingSessionEventHandler);<o:p></o:p>
<o:p> </o:p>This event send customer data and I can see that in logs. But data does not get populated in CRM page. Need help in achieving this functionality using Signalr. Sample code would be appreciated. Thanks in advance.
<o:p></o:p>
Tuesday, December 12, 2017 5:45 AM
Answers
-
User61956409 posted
<o:p>
I would like to use SignalR which is used to send the events from server-side-app (using SignalR library ) to browser (using SignalR jQuery library).</o:p>Based on your requirements, you should have server-side app, Hub server and client application. If you’d like to call Hub method to send messages (events) to client application in your server-side app, you can try to use the following code to invoke Hub method in your server-side app.<o:p></o:p>
var hub = new HubConnection("http://xxxx:port/"); var proxy = hub.CreateHubProxy("ChatHub"); hub.Start().Wait(); //invoke hub method proxy.Invoke("hub_method_name", params);
<o:p>
data does not get populated in CRM page</o:p>If you want your clients can receive messages that are broadcast from Hub server, please make sure the clients establish connection to your Hub server.<o:p></o:p>
With Regards,<o:p></o:p>
Fei Han<o:p></o:p>
- Marked as answer by Anonymous Thursday, October 7, 2021 12:00 AM
Wednesday, December 13, 2017 3:01 AM
All replies
-
User61956409 posted
<o:p>
I would like to use SignalR which is used to send the events from server-side-app (using SignalR library ) to browser (using SignalR jQuery library).</o:p>Based on your requirements, you should have server-side app, Hub server and client application. If you’d like to call Hub method to send messages (events) to client application in your server-side app, you can try to use the following code to invoke Hub method in your server-side app.<o:p></o:p>
var hub = new HubConnection("http://xxxx:port/"); var proxy = hub.CreateHubProxy("ChatHub"); hub.Start().Wait(); //invoke hub method proxy.Invoke("hub_method_name", params);
<o:p>
data does not get populated in CRM page</o:p>If you want your clients can receive messages that are broadcast from Hub server, please make sure the clients establish connection to your Hub server.<o:p></o:p>
With Regards,<o:p></o:p>
Fei Han<o:p></o:p>
- Marked as answer by Anonymous Thursday, October 7, 2021 12:00 AM
Wednesday, December 13, 2017 3:01 AM -
User1806771833 posted
Thanks Han I was actually thinking of doing so but not sure , now it's more clear to me. thanks again.
Wednesday, December 13, 2017 3:24 AM