服务器中接收到的soap协议传输的数据如下:<?xml version="1.0" encoding="UTF-8"?>
<soapenv:Envelope xmlns:soapenv="http://schemas.xmlsoap.org/soap/envelope/" xmlns:xsd="http://www.w3.org/2001/XMLSchema" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance">
<soapenv:Body>
<ns1:orderRelationUpdateNotify soapenv:encodingStyle="http://schemas.xmlsoap.org/soap/encoding/" xmlns:ns1="http://soap.bossagent.vac.unicom.com">
<orderRelationUpdateNotifyRequest href="#id0"/>
</ns1:orderRelationUpdateNotify>
<multiRef id="id0" soapenc:root="0" soapenv:encodingStyle="http://schemas.xmlsoap.org/soap/encoding/" xsi:type="ns2:OrderRelationUpdateNotifyRequest" xmlns:soapenc="http://schemas.xmlsoap.org/soap/encoding/" xmlns:ns2="http://req.sync.soap.bossagent.vac.unicom.com">
<CreateTime href="#id1"/>
<UserorderTime xsi:type="soapenc:string"></updateTime>
</multiRef>
<multiRef id="id1" soapenc:root="0" soapenv:encodingStyle="http://schemas.xmlsoap.org/soap/encoding/" xsi:type="soapenc:int" xmlns:soapenc="http://schemas.xmlsoap.org/soap/encoding/">Y</multiRef>
</soapenv:Body>
</soapenv:Envelope>
现在我需要读取CreateTime标签对应的值,可它的值是按soap协议放在id为 id1 的标签处的。他这次是id1下次就有可能是idN 那么我如何去取这个值?
有没有一个标准的方法,使用后可以直接取到CreateTime对应的值,而不用我再去分析他的href,再根据href去找那个值?
<soapenv:Envelope xmlns:soapenv="http://schemas.xmlsoap.org/soap/envelope/" xmlns:xsd="http://www.w3.org/2001/XMLSchema" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance">
<soapenv:Body>
<ns1:orderRelationUpdateNotify soapenv:encodingStyle="http://schemas.xmlsoap.org/soap/encoding/" xmlns:ns1="http://soap.bossagent.vac.unicom.com">
<orderRelationUpdateNotifyRequest href="#id0"/>
</ns1:orderRelationUpdateNotify>
<multiRef id="id0" soapenc:root="0" soapenv:encodingStyle="http://schemas.xmlsoap.org/soap/encoding/" xsi:type="ns2:OrderRelationUpdateNotifyRequest" xmlns:soapenc="http://schemas.xmlsoap.org/soap/encoding/" xmlns:ns2="http://req.sync.soap.bossagent.vac.unicom.com">
<CreateTime href="#id1"/>
<UserorderTime xsi:type="soapenc:string"></updateTime>
</multiRef>
<multiRef id="id1" soapenc:root="0" soapenv:encodingStyle="http://schemas.xmlsoap.org/soap/encoding/" xsi:type="soapenc:int" xmlns:soapenc="http://schemas.xmlsoap.org/soap/encoding/">Y</multiRef>
</soapenv:Body>
</soapenv:Envelope>
现在我需要读取CreateTime标签对应的值,可它的值是按soap协议放在id为 id1 的标签处的。他这次是id1下次就有可能是idN 那么我如何去取这个值?
有没有一个标准的方法,使用后可以直接取到CreateTime对应的值,而不用我再去分析他的href,再根据href去找那个值?
/// <summary>
/// 获取新加入插件的ID
/// </summary>
/// <returns>id号</returns>
public int GetID()
{
XmlDocument xmlDoc = new XmlDocument();
xmlDoc.Load(Application.StartupPath + "\\Plugins\\Plugin.xml");
int id = 1; for ( id = 1; ; id++)
{
XmlNode node = xmlDoc.SelectSingleNode("ClassInfo/class[@Id='" + id + "']");
if (node == null)
{
return id;
}
}
}这样来稿
你的意思是我先去取那个id号,再拿这个id号去找值? 我是担心他过段时间又写成这样:
<CreateTime>Y</CreateTime>
所以想问下有没有方便的方法。