必须在 Newtonsoft.Json.Linq.JObject 上实现默认访问器,因为它继承自 ICollection

MrHGG 2017-03-10 09:02:58
引用了Newtonsoft.Json.Linq;
发布webserver就异常:必须在 Newtonsoft.Json.Linq.JObject 上实现默认访问器,因为它继承自 ICollection

[WebMethod]
public VenderShopQueryResponse JDAppkeyTest(string Appkey, string AppSecret, string SessionKey, out string messageStr)
{
messageStr = "连接正常";
IJdClient client = new DefaultJdClient("https://api.jd.com/routerjson", Appkey, AppSecret, SessionKey);
VenderShopQueryRequest req = new VenderShopQueryRequest();
VenderShopQueryResponse rsp;
try
{
rsp = client.Execute(req);
if (rsp.IsError)
{
messageStr = rsp.ErrMsg.ToString();
return null;
}
}
catch (Exception ex)
{
messageStr = "连接失败!";
return null;
}
return rsp;
}
...全文
1171 回复 打赏 收藏 转发到动态 举报
写回复
用AI写文章
回复
切换为时间正序
请发表友善的回复…
发表回复

110,536

社区成员

发帖
与我相关
我的任务
社区描述
.NET技术 C#
社区管理员
  • C#
  • Web++
  • by_封爱
加入社区
  • 近7日
  • 近30日
  • 至今
社区公告

让您成为最强悍的C#开发者

试试用AI创作助手写篇文章吧