PHP SOAP 请求 - 得到空结果

balicect

我想从 SOAP API 获取数据。更多细节在这里:https : //iskam-web.zcu.cz/WebServices/Menus.asmx?op=Facilities

以下是请求信息: 在此处输入图片说明

我的 PHP 代码如下所示:

    $soap = new SoapClient("https://iskam-web.zcu.cz/WebServices/Menus.asmx?wsdl");
    $xml = $soap->Facilities(array());

    print "<pre>";
    print_r($xml);
    print "</pre>";

但我得到的答案是这样的:

在此处输入图片说明

所以这意味着结果是空的。是我做错了什么还是 API 不起作用?

谢谢!

狮子座

在那个 wsdl 中的工具方法它没有指定任何东西,甚至没有指定需要传递什么数据。只是你没有做错任何事,但设施方法返回一个空对象。意思是没有数据。这是来自设施的 xml 响应:

<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>
      <FacilitiesResponse xmlns="http://aps-brno.cz/"/>
   </soap:Body>
</soap:Envelope>

在这种情况下,我建议从 Web 服务的支持中获得一些支持。

如果你尝试打电话

   $soap = new SoapClient("https://iskam-web.zcu.cz/WebServices/Menus.asmx?wsdl");
        $response  = $soap->DistributionPeriods(['FacilityID' => '123123123123123-123123123-123123123', 'Day' => '4']);

        print "<pre>";
        print_r($response);
        print "</pre>";

将要求您传递格式如下的设施 ID:Guid should contain 32 digits with 4 dashes (xxxxxxxx-xxxx-xxxx-xxxx-xxxxxxxxxxxx)这样我相信你会得到一些数据。

本文收集自互联网,转载请注明来源。

如有侵权,请联系 [email protected] 删除。

编辑于
0

我来说两句

0 条评论
登录 后参与评论

相关文章