1

I face the next problem. I try to connect to SignalR server. I create HubConnection instance and the start connection. That is successfully. But when I create proxy hub for that connection I get exception. SignalR version 2.2.0 Code example:

hubConnection = new HubConnection(inputDataContract.rootUrl + inputDataContract.defaultServicePath);
hubConnection.TraceLevel = TraceLevels.All;
hubConnection.TraceWriter = Console.Out;
hubConnection.Start().ContinueWith(task => {
            if (task.IsFaulted)
            {
                Console.WriteLine("There was an error opening the connection:{0}",
                                  task.Exception.GetBaseException());
            }
            else
            {
                Console.WriteLine("Connected");
            }

        }).Wait();

hubConnection.Stop();

That above code is executed successfully.

Log of connection

But next piece of code leads to error

hubConnection = new HubConnection(inputDataContract.rootUrl + inputDataContract.defaultServicePath);
            hubConnection.TraceLevel = TraceLevels.All;
            hubConnection.TraceWriter = Console.Out;

            hubProxy = hubConnection.CreateHubProxy("Configurator");

            hubProxy.On<EventArgs>("valueChanged", res => onValueChanged(res));
            hubProxy.On<EventArgs>("configurationStateChanged", res => onConfigurationStateChanged(res));
            hubProxy.On<EventArgs>("componentModifierChanged", res => onComponentModifierChanged(res));
            hubProxy.On<EventArgs>("attributeFeasibility", res => onAttributeFeasibility(res));
            hubProxy.On<EventArgs>("attributeModifierChanged", res => onAttributeModifierChanged(res));
            hubProxy.On<EventArgs>("calculationSummary", res => onCalculationSummary(res));
            hubProxy.On<EventArgs>("configurationError", res => onConfigurationError(res));
            hubProxy.On<EventArgs>("unhandledTaskException", res => onUnhandledTaskException(res));


            hubConnection.Start().ContinueWith(task => {
                if (task.IsFaulted)
                {
                    Console.WriteLine("There was an error opening the connection:{0}",
                                      task.Exception.GetBaseException());
                }
                else
                {
                    Console.WriteLine("Connected");
                }

            }).Wait();

            hubConnection.Stop();

Error msg

I will be very appreciate for any help.

  • Interesting. Could you [edit] the JSON of the call into your question? The error message seem to indicate that something went wrong when parsing the JSON. Also, could you provide some information how you integrated SignalR with D365FO? – FH-Inway Aug 31 '18 at 14:54
  • Thanks for response. I have already found workaround. I think in my case something was wrong with security. I don't have source code of SignalR server side. But I have checked config files and it looks like SignalR server require cookies auth like it have user interactive session. With D365 get the same context from third-party app is not easy and not correct. About integration SignalR with D365 I can tell you mo information if you are interested in. Contact me via skype - srvsever. Thanks once again for response. – Craig Bowen Sep 01 '18 at 04:18

0 Answers0