以下是SOAP响应,我该如何使用XPATH对响应内容进行测试/验证?注意:我在使用RunScope测试我们的API。
<?xml version="1.0" encoding="utf-8"?>
<soap:Envelope xmlns:soap="http://schemas.xmlsoap.org/soap/envelope/" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xmlns:xsd="http://www.w3.org/2001/XMLSchema">
<soap:Body>
<GetValidDataExtractResponse xmlns="http://some.namespace">
<GetValidDataForExtractResult>
<long>1001</long>
<long>1002</long>
</GetValidDataForExtractResult>
</GetValidDataExtractResponse>
</soap:Body>
</soap:Envelope>
我可以通过使用以下方法得到一个有效值:/soap:Envelope/soap:Body 但是,这无法让我更深入地了解“主体中是否存在某些内容”。 我希望能够确定“GetValidDataExtractResponse”节点是否包含任何内容,还希望确定“etValidRentalUnitIdsForExtractResult”节点是否包含X个项目或该节点是否包含特定值。