<?xml version="1.0" encoding="UTF-8" standalone="yes"?>
<response>
<flag>success</flag>
<code>SUCCESS</code>
<message>查询成功!</message>
<items>
<item>
<warehouseCode>B01</warehouseCode>
<itemCode>123</itemCode>
<itemId>123</itemId>
<inventoryType>CC</inventoryType>
<quantity>3</quantity>
<lockQuantity>0</lockQuantity>
</item>
<item>
<warehouseCode>B01</warehouseCode>
<itemCode>333</itemCode>
<itemId>555</itemId>
<inventoryType>ZP</inventoryType>
<quantity>5239</quantity>
<lockQuantity>0</lockQuantity>
</item>
</items>
</response>
对应的 struct
Response struct {
XMLName xml.Name `xml:"response"`
Flag string `xml:"flag"`
Code string `xml:"code"`
Message string `xml:"message"`
Items []Item `xml:"items"`
}
Item struct {
WarehouseCode string `xml:"warehouseCode"`
ItemCode string `xml:"itemCode"`
ItemID string `xml:"itemId"`
InventoryType string `xml:"inventoryType"`
Quantity string `xml:"quantity"`
LockQuantity string `xml:"lockQuantity"`
}
结果打印出来 xml Response Items : [{ }]
Items 竟然是 空 请求大佬 这样的 xml 不是这么定义的吗?
找个大佬 指导一下咯 ?