H
H
HappyCougar2014-06-02 22:22:27
PHP
HappyCougar, 2014-06-02 22:22:27

Using Soap for Parsing

I came across this code:

$client = new SoapClient("http://www.cbr.ru/DailyInfoWebServ/DailyInfo.asmx?WSDL");
print "<pre>";
print_r($client->EnumValutes(false));

It seems like a worker, but for some reason only the first object is parsed and not completely. Can php use Soap normally?
www.cbr.ru/scripts/Root.asp?PrtId=DWS - description of working with Soap API CB

Answer the question

In order to leave comments, you need to log in

1 answer(s)
T
toxa82, 2014-06-09
@toxa82

Maybe he gets the full answer, you just don’t see the whole picture in print_r, it goes a lot to the left, and plus the tags are hidden. You'd better use var_dump() to output the answer.

$oRet = $client->EnumValutes();
$oXml = simplexml_load_string($oRet->EnumValutesResult->any);
foreach ($oXml->ValuteData->EnumValutes as $oCurr) {
    echo $oCurr->VcharCode . '|' . $oCurr->VnumCode . '|' . $oCurr->Vname . '<br/>';
}

Didn't find what you were looking for?

Ask your question

Ask a Question

731 491 924 answers to any question