<WebxApi>
<Search>
<SessionId>49B9BB6E-D2BD-427E-BB38-C3BD37B216E1</SessionId>
</Search>
<Search>
<SessionId>49B9BB6E-D2BD-427E-BB38-C3BD37B216E1</SessionId>
</Search>
<Search>
<SessionId>651CE157-1ED7-4644-A6A6-93CE1FEA522D</SessionId>
</Search>
</WebxApi>
我在搜索的输入请求中有这个 xml,我正在尝试使用以下代码反序列化。
var serializer = new XmlSerializer(typeof(WebxApi));
var sReader = new StringReader(sw.ToString());
var request = serializer.Deserialize(XmlReader.Create(sReader)) as WebxApi;
[Serializable]
public class WebxApi
{
private List<SearchRequest> search;
public WebxApi()
{
this.Search= new List<SearchRequest>();
}
[System.Xml.Serialization.XmlArrayAttribute()]
public List<SearchRequest> Search
{
get
{
return search ;
}
set
{
search = value;
}
}
}
[Serializable]
public partial class SearchRequest
{
public string SessionId { get; set; }
}
所有过程都成功完成但是当我尝试获取搜索列表时给我 count= 0
谁能告诉我哪里出错了
谢谢