<? $client = new SoapClient("http://nbrb.by/Services/ExRates.asmx?WSDL", array( "trace" => 1, "exceptions" => 0 )); $curs = $client->ExRatesDyn(getSOAPDate(time())); print_r($curs); function getSOAPDate($timeStamp, $withTime = true) { $soapDate = date("Ymd", $timeStamp); return ($withTime) ? $soapDate . "T" . date("H:i:s", $timeStamp) : $soapDate . "T00:00:00"; } ?> 

With this code I tried to get xml with currency rates, but I got a fig. Although other methods work on the same service. Where there is no date as a parameter.

    1 answer 1

    Judging by the WSDL there are 3 parameters, IdValuts, DataOt, Datac

    sort of...

     <s:element minOccurs="1" maxOccurs="1" name="curId" type="s:int"/> <s:element minOccurs="1" maxOccurs="1" name="fromDate" type="s:dateTime"/> <s:element minOccurs="1" maxOccurs="1" name="toDate" type="s:dateTime"/> 
    • Incorrectly specified method, in fact, so ExRatesDaily $ curs = $ client-> ExRatesDaily (getSOAPDate (time ())); - Alexander Zheleznovsky