我对 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;  
}