首页 新闻 搜索 专区 学院

xml-rpc.net解析返回的xml

0
悬赏园豆:200 [待解决问题]

我利用xml-rpc.net进行网络的下载返回xml,形式如下:

<?xml version="1.0" encoding="UTF-8"?>
<methodResponse xmlns:ex="http://ws.apache.org/xmlrpc/namespaces/extensions">
<params>
<param>
<value>
<array>
<data>
<value>
<struct>
<member>
<name>dt_deleted</name>
<value>
<dateTime.iso8601>20120317T16:41:15</dateTime.iso8601>
</value>
</member>
<member>
<name>deleted_guid</name>
<value>89c02dc4-4176-4992-9bb9-5cc472cf4964</value>
</member>
<member>
<name>guid_type</name>
<value>attachment</value>
</member>
<member>
<name>version</name>
<value>1</value>
</member>
</struct>
</value>
<value>
<struct>
<member>
<name>dt_deleted</name>
<value>
<dateTime.iso8601>20120317T16:41:27</dateTime.iso8601>
</value>
</member>
<member>
<name>deleted_guid</name>
<value>b2f42799-4c61-4550-a547-f125a64f6cd4</value>
</member>
<member>
<name>guid_type</name>
<value>attachment</value>
</member>
<member>
<name>version</name>
<value>2</value>
</member>
</struct>
</value>
<value>
<struct>
<member>
<name>dt_deleted</name>
<value>
<dateTime.iso8601>20120317T16:41:27</dateTime.iso8601>
</value>
</member>
<member>
<name>deleted_guid</name>
<value>b79a3649-40bc-4c4a-ac7c-7267252539eb</value>
</member>
<member>
<name>guid_type</name>
<value>document</value>
</member>
<member>
<name>version</name>
<value>3</value>
</member>
</struct>
</value>
<value>
<struct>
<member>
<name>dt_deleted</name>
<value>
<dateTime.iso8601>20120317T16:41:31</dateTime.iso8601>
</value>
</member>
<member>
<name>deleted_guid</name>
<value>130ed223-41c3-48c4-88df-582728dc91a0</value>
</member>
<member>
<name>guid_type</name>
<value>document</value>
</member>
<member>
<name>version</name>
<value>4</value>
</member>
</struct>
</value>
<value>
<struct>
<member>
<name>dt_deleted</name>
<value>
<dateTime.iso8601>20120317T16:41:39</dateTime.iso8601>
</value>
</member>
<member>
<name>deleted_guid</name>
<value>469f6831-9c36-40d4-8c0e-3cf9bf5d173a</value>
</member>
<member>
<name>guid_type</name>
<value>document</value>
</member>
<member>
<name>version</name>
<value>5</value>
</member>
</struct>
</value>
<value>
<struct>
<member>
<name>dt_deleted</name>
<value>
<dateTime.iso8601>20120403T17:12:12</dateTime.iso8601>
</value>
</member>
<member>
<name>deleted_guid</name>
<value>c49e88df-027d-4ea8-a538-700da3f81beb</value>
</member>
<member>
<name>guid_type</name>
<value>document</value>
</member>
<member>
<name>version</name>
<value>6</value>
</member>
</struct>
</value>
<value>
<struct>
<member>
<name>dt_deleted</name>
<value>
<dateTime.iso8601>20120403T17:12:17</dateTime.iso8601>
</value>
</member>
<member>
<name>deleted_guid</name>
<value>dfdc9a0c-b4cf-46a8-8a26-66973e369969</value>
</member>
<member>
<name>guid_type</name>
<value>document</value>
</member>
<member>
<name>version</name>
<value>7</value>
</member>
</struct>
</value>
<value>
<struct>
<member>
<name>dt_deleted</name>
<value>
<dateTime.iso8601>20120403T19:59:41</dateTime.iso8601>
</value>
</member>
<member>
<name>deleted_guid</name>
<value>54dbc3c0-8fc0-4317-9f3b-8bf2a0919c5b</value>
</member>
<member>
<name>guid_type</name>
<value>document</value>
</member>
<member>
<name>version</name>
<value>8</value>
</member>
</struct>
</value>
</data>
</array>
</value>
</param>
</params>
</methodResponse>

在调试时发现它利用的ParseFault函数解析的

这是我接受的代码

private void AddPer(string name)
{
DeletedGuidHelper.DeletedGuidRequest dg = new DeletedGuidHelper.DeletedGuidRequest();
dg.api_version = "4";
dg.client_type = "WP7";
dg.count = 200;
UserHelper users = new UserHelper();
Users u = users.GetUser(name);
dg.kb_guid = u.Kb_guid;
dg.program_type = "normal";
dg.token = u.Token;
MetaHelper mh = new MetaHelper();
WizMeta wm = mh.GetWizMeta("SYNC_VERSION", "DELETED_GUID");
if (wm.Meta_Value == null)
{
mh.InsertMeta("SYNC_VERSION", "DELETED_GUID", "0");
dg.version = "0";
}
else
{
dg.version = wm.Meta_Value;
}

password = u.Kapi_url;
SendXml(dg);
DeletedGuidHelper dgh = new DeletedGuidHelper();

var proxy = new StateNameProxy();
object ll1 = null;
proxy.BeginGetWizDeletedGuid(new object[] { dg }, asr =>
{
Dispatcher.BeginInvoke(delegate()
{
try
{
ll1 = proxy.EndGetWizDeletedGuid(asr);
}
catch (XmlRpcFaultException fex)
{
}
catch (Exception ex)
{
}
});
});
ll = (List<DeletedGuidHelper.KObjectDeleted>)ll1;
//textBlock1.Text = ll.Count.ToString();

}

调试的时候发现ll1是null

我的登录是可以的请各位高手们个看看

实力才是永远的牛B的主页 实力才是永远的牛B | 初学一级 | 园豆:5
提问于:2012-04-09 15:16
< >
分享
所有回答(2)
-1

你倒底想问什么,null是正常还是不正常,你给的代码根本不能调试,很多找不到的类,又不说清楚想干嘛。

秦楼东 | 园豆:913 (小虾三级) | 2012-04-09 15:35

返回的应该是个对象,代码不齐,那个只是参考

@实力才是永远的牛B: 

关键是你的问题没说清楚,整个执行过程没报错的话,那就是没问题,那个为null的ll1不能说明什么,因为对方返回给你null完全是可以的,也许你的请求不对,对方只能返回null给你,但是这个别人无法知道。

支持(0) 反对(0) 秦楼东 | 园豆:913 (小虾三级) | 2012-04-09 16:13
0

搜索树

实力才是永远的牛B | 园豆:5 (初学一级) | 2012-04-09 18:44
清除回答草稿
   您需要登录以后才能回答,未注册用户请先注册