首页新闻找找看学习计划

xml-rpc.net解析返回的xml

0
悬赏园豆:140 [已关闭问题] 关闭于 2012-04-09 15:09

我利用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 13:06
< >
分享
清除回答草稿
   您需要登录以后才能回答,未注册用户请先注册