PHP soap调用始终返回零

时间:2014-05-07 18:26:38

标签: php soap

我有这段代码:

    try
    {
      $oClient   = new SoapClient('http://www.webservicex.net/CurrencyConvertor.asmx?WSDL');
      $mResponse = $oClient->__soapCall(
        'ConversionRate',
        array(
          'FromCurrency' => 'USD',
          'ToCurrency'   => 'EUR'
        )
      );

      echo print_r($mResponse,1);
    }
    catch (SoapFault $fault)
    {
      trigger_error("SOAP Fault: (faultcode: {$fault->faultcode}, faultstring: {$fault->faultstring})", E_USER_ERROR);
    }

我得到的结果总是为零:

stdClass Object
(
    [ConversionRateResult] => 0
)

有人可以帮我解决这个问题吗?

0 个答案:

没有答案