我完全不了解SOAP操作。
我收到了一个XML文档(SOAP),用于获取一些运输方式的集合点。
从这里的手册中:
http://privpakservices.schenker.nu/package/package_1.3/packageservices.asmx?op=SearchCollectionPoint
我能看到我需要使用以下SOAP请求:POST /package/package_1.3/packageservices.asmx HTTP/1.1
Host: privpakservices.schenker.nu
Content-Type: text/xml; charset=utf-8
Content-Length: length
SOAPAction: "http://privpakservices.schenker.nu/SearchCollectionPoint"
<?xml version="1.0" encoding="utf-8"?>
<soap:Envelope xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xmlns:xsd="http://www.w3.org/2001/XMLSchema" xmlns:soap="http://schemas.xmlsoap.org/soap/envelope/">
<soap:Body>
<SearchCollectionPoint xmlns="http://privpakservices.schenker.nu/">
<customerID>long</customerID>
<key>string</key>
<serviceID>string</serviceID>
<paramID>int</paramID>
<address>string</address>
<postcode>string</postcode>
<city>string</city>
<maxhits>int</maxhits>
</SearchCollectionPoint>
</soap:Body>
</soap:Envelope>
事情是我不知道如何使用PHP发送请求,以及如何获取响应。
任何帮助指引我正确方向的都非常感激。
更新
我可以通过var_dump读取响应数据。然而,我无法读取单个元素数据。
我需要按以下方式读取数据。
foreach($parser as $row) {
echo $row->customerID;
echo $row->key;
echo $row->serviceID;
}