botbuilder-community-dotnet
botbuilder-community-dotnet copied to clipboard
turnContext is not coming in MS Wrapper
Hi All,
As turnContext object is used to get the User details but we are unable to get the user's platform details in ServiceNow Controller of MS wrapper. Can someone provide any suggestion/solution to get the turnContext details in ServiceNow Controller in MS Wrapper.
@Deepti886 Have you checked Channel Data information
Hi @rvinothrajendran , but I am not getting turnContext itself in the Controller, hence could not check channel data information. How Should I proceed then?
@Deepti886 why you want to handle in the controller ? explain your use case ?
@rvinothrajendran I wanted to handle turnContext in the controller so that it can be used for exception logging if any exception occurs in controller. We wanted to log platform details of the user who has chatted as well while logging. Hence, it would be helpful if you could suggest some solution for this.
@Deepti886 turnContext has created by the Adapter if any error has occurred handle in the ex : AdapterWithErrorHandler.cs class If any exception has raised before calling "ProcessAsync" In this case you can handle like try { //throw new Exception("BotController Exception"); await Adapter.ProcessAsync(Request, Response, Bot); } catch (Exception) { var activity = await HttpHelper.ReadRequestAsync<Activity>(Request);
}
@rvinothrajendran Thank you for your suggestion. Would like to also mention that we wanted to handle turnContext in the controller so that it can be used for logging of Chatscripts for the Users as well. We wanted to log platform details of the user who has chatted and in which platform he is chatting. Hence, it would be helpful if you could suggest some solution for this.
@rvinothrajendran Would like to follow up on the above ask. Please let me know if there is any update on the above ask?
@rvinothrajendran Would like to follow up to know if there is any update on the above ask?
@Deepti886 Have you checked var activity = await HttpHelper.ReadRequestAsync(Request); "activity" info ?
@rvinothrajendran Did you mean to put and check var activity = await HttpHelper.ReadRequestAsync(Request); "activity" info in ServiceNowController.cs class of MS Wrapper solution or in the default BotController.cs class because we wanted to handle and need these details in the ServiceNowController.cs class?