Unable to deserialize the response - GetUserDataAsync

人走茶凉 提交于 2019-12-25 17:17:10

问题


I am working bot technology, in one of my project I used bot state concept to get the bot data and set new data here I used state client object like this below

 //var stateClient = new StateClient(new Uri("http://localhost:9000/"));
   var stateClient = new StateClient(new Uri("https://skype.botframework.com"));

This is code I wrote in LoginController.cs

                if (stateClient != null)
                {
                    var getData = await stateClient.BotState.GetUserDataAsync(Constants.Constants.botId, activity.From.Id);// 29:1_12CsCTqilHlQTG9KI8YmvCKd - zwzekm2IDKR7xN8EVE3gjtfNQYp1aOzuC9Rs_t
                    //var getData = await client.B.GetUserDataAsync(Constants.Constants.botId, userid);
                    getData.Data = ar.Serialize();
                    var foo = await stateClient.BotState.SetUserDataAsync(Constants.Constants.botId, activity.From.Id, getData);
                    //var foo = await client.Bots.SetUserDataAsync(Constants.Constants.botId, userid, getData);
                }

The above code will work in bot emulator successfully without exception. but when I added bot to skype then started to chat at that time I am getting exception 'Unable to deserialize the response' after executed this line

var getData = await stateClient.BotState.GetUserDataAsync(Constants.Constants.botId, activity.From.Id);

Please tell me how resolve it.


回答1:


You might need to use https://state.botframework.com as the endpoint for the StateClient rather than skype.botframework.com.



来源:https://stackoverflow.com/questions/39483415/unable-to-deserialize-the-response-getuserdataasync

易学教程内所有资源均来自网络或用户发布的内容,如有违反法律规定的内容欢迎反馈
该文章没有解决你所遇到的问题?点击提问,说说你的问题,让更多的人一起探讨吧!