【发布时间】:2016-07-25 06:53:00
【问题描述】:
我正在尝试将列表发送到 wcf。 我想把它作为json发送,有什么办法吗?
当我尝试序列化时,我得到空字符串,为什么?
public string ImportXml(List<XmlDocument> docs,string token)
{
Account user = GetCurrentUser(token);
string url = string.Format("{0}ImportXml/{1}", ServiceUrl, user.Unumber);
string contentType = "text/json";
x.Serialize(Console.Out, docs);
string jsonReq = _serializer.Serialize(docs);
bool response = false;
HttpRequestHandler handler = new HttpRequestHandler();
string result = handler.HttpPostWithToken(url, jsonReq, contentType, token);
return result ;
}
【问题讨论】:
-
文档列表中是否有任何内容?