【问题标题】:Web Service List RecordWeb服务列表记录
【发布时间】:2015-02-06 10:50:47
【问题描述】:

以下是我的网络服务结果,如何更改记录名称以使其具有唯一性?例如Record1, Record2, Record3.

This XML file does not appear to have any style information associated with it. The document tree is shown below.
<ArrayOfRecord xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xmlns:xsd="http://www.w3.org/2001/XMLSchema" xmlns="http://tempuri.org/">
<Record> /*How to change this Record to Record1*/
<item>
Buffalo DriveStation Combo 3.5 inch External Hard Drive USB 2.0 1.5TB Quadra
</item>
<qty>1</qty>
<qtyapproved>1</qtyapproved>
<availability>0</availability>
<description>Returned</description>
<itemdescription>-</itemdescription>
<id>188</id>
</Record>
<Record>
<item>eSataII HDD Docking with 1TB 3.5 inch hard disk</item>
<qty>1</qty>
<qtyapproved>1</qtyapproved>
<availability>0</availability>
<description>Returned</description>
<itemdescription/>
<id>184</id>
</Record>
</ArrayOfRecord>

【问题讨论】:

    标签: c# xml web service


    【解决方案1】:

    如果您没有任何唯一列,则可以使用序列号,而不是更改记录名称,在 Web 服务返回的结果集中包含唯一列。

    例如,您可以在 Record 中添加 itemId 一个新列

    <Record> /*How to change this Record to Record1*/
    <itemId>1</itemId>
    <item>
    Buffalo DriveStation Combo 3.5 inch External Hard Drive USB 2.0 1.5TB Quadra
    </item>
    <qty>1</qty>
    <qtyapproved>1</qtyapproved>
    <availability>0</availability>
    <description>Returned</description>
    <itemdescription>-</itemdescription>
    <id>188</id>
    </Record>
    

    【讨论】:

      猜你喜欢
      • 2011-03-28
      • 2013-03-18
      • 1970-01-01
      • 2010-09-13
      • 1970-01-01
      • 2012-08-06
      • 2015-11-27
      • 1970-01-01
      • 2013-02-08
      相关资源
      最近更新 更多