我需要使用 SOAP api 并从响应中提取值。我对命名字段没有问题,但是这次响应是数组。这是示例响应:
<soap:Envelope
xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
xmlns:soapenc="http://schemas.xmlsoap.org/soap/encoding/"
xmlns:xsd="http://www.w3.org/2001/XMLSchema"
soap:encodingStyle="http://schemas.xmlsoap.org/soap/encoding/"
xmlns:soap="http://schemas.xmlsoap.org/soap/envelope/">
<soap:Body>
<getDhcpForPortResponse
xmlns="urn:DHCPProv">
<soapenc:Array
soapenc:arrayType="soapenc:Array[2]"
xsi:type="soapenc:Array">
<item
soapenc:arrayType="xsd:string[5]"
xsi:type="soapenc:Array">
<item
xsi:type="xsd:string">
qbtp8482tv
</item>
<item
xsi:type="xsd:string">
172.28.223.117
</item>
<item
xsi:type="xsd:string">
bc644ba2501c
</item>
<item
xsi:type="xsd:string">
MA5600T_AMD-Vitez atm 0/13/0/49:0.40
</item>
<item
xsi:type="xsd:string"/>
</item>
<item
soapenc:arrayType="xsd:string[5]"
xsi:type="soapenc:Array">
<item
xsi:type="xsd:string">
qbtp8482tv
</item>
<item
xsi:type="xsd:string">
172.28.223.126
</item>
<item
xsi:type="xsd:string">
704fb8f3e4e1
</item>
<item
xsi:type="xsd:string">
MA5600T_AMD-Vitez atm 0/13/0/49:0.40
</item>
<item
xsi:type="xsd:string"/>
</item>
</soapenc:Array>
</getDhcpForPortResponse>
</soap:Body>
</soap:Envelope>
有没有办法用 EXTRACTVALUE 或其他方法提取数组字段?提前致谢!
编辑:我的肥皂包装返回这个 xml:
<soap:Envelope xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xmlns:soapenc="http://schemas.xmlsoap.org/soap/encoding/" xmlns:xsd="http://www.w3.org/2001/XMLSchema" soap:encodingStyle="http://schemas.xmlsoap.org/soap/encoding/" xmlns:soap="http://schemas.xmlsoap.org/soap/envelope/">
<soap:Body>
<getDhcpForUsernameResponse xmlns="urn:DHCPProv">
<soapenc:Array soapenc:arrayType="soapenc:Array[2]" xsi:type="soapenc:Array">
<item soapenc:arrayType="xsd:string[5]" xsi:type="soapenc:Array">
<item xsi:type="xsd:string">qbtp8482tv</item>
<item xsi:type="xsd:string">172.28.223.117</item>
<item xsi:type="xsd:string">bc644ba2501c</item>
<item xsi:type="xsd:string">MA5600T_AMD-Vitez atm 0/13/0/49:0.40</item>
<item xsi:type="xsd:string"/>
</item>
<item soapenc:arrayType="xsd:string[5]" xsi:type="soapenc:Array">
<item xsi:type="xsd:string">qbtp8482tv</item>
<item xsi:type="xsd:string">172.28.223.126</item>
<item xsi:type="xsd:string">704fb8f3e4e1</item>
<item xsi:type="xsd:string">MA5600T_AMD-Vitez atm 0/13/0/49:0.40</item>
<item xsi:type="xsd:string"/>
</item>
</soapenc:Array>
</getDhcpForUsernameResponse>
</soap:Body>
</soap:Envelope>
但是当我在 select 语句中使用该 xml 时,它不会从中获取任何值。与我发布的从wireshark复制的第一个相比有什么区别?