货币转换器的 webservicex 不起作用

webservicex for Currency Convertor don't work

我正在尝试开发一个电子商务网站。 为了管理多币种,我想使用 webservice 进行自动转换。 所以我尝试了这个网络服务:http://www.webservicex.com/CurrencyConvertor.asmx?WSDL 使用以下代码:

     try
        {
            $wsdl="http://www.webservicex.com/CurrencyConvertor.asmx?WSDL";
            $webservice = new \SoapClient( $wsdl );

            $country=array();

            // Set the country variable to the country codes.
            $country['FromCurrency']= 'USD';
            $country['ToCurrency'] = 'EUR';

            $webservice->ConversionRate($country);


            echo $response->ConversionRateResult;*/
        }catch(Exception $oException)

        {
            printf(
                '<h4 style="color: Red">Exception</h4>
                <p>%s</p>',
                $oException->getMessage()
            );
        } `

不幸的是,服务returns我 - 1 是我的代码有问题还是服务不再有效!!

您知道另一个稳定的 Web 服务吗? 非常感谢

看看

https://openexchangerates.org/

http://fixer.io/

他们都有一个直接的 API 你可以整合到。