balicekt
balicekt

Reputation: 613

PHP SOAP request - get empty result

I wanto to get data from SOAP API. More details is here: https://iskam-web.zcu.cz/WebServices/Menus.asmx?op=Facilities

Here are request informations: enter image description here

and my PHP code looks like this:

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

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

but the answer I get looks like this:

enter image description here

so it means the result is empty. Is there something what am I doing wrong or the API is just not working?

Thank you!

Upvotes: 1

Views: 918

Answers (1)

Leo
Leo

Reputation: 7420

Facilities method in that wsdl it does not specify anything not even what data needs to be passed. Simply you are not doing anything wrong but the Facilities method returns an empty object. Meaning no data. This is the xml response from Facilities:

<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>

In this case I suggest to reach some support from the web service's support.

If you try to call

   $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>";

Will ask you to pass an Facility ID formatted like: Guid should contain 32 digits with 4 dashes (xxxxxxxx-xxxx-xxxx-xxxx-xxxxxxxxxxxx) . That way I believe you will get some data back.

Upvotes: 1

Related Questions