必须在 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;
}