strauss February 2016

webservicex for Currency Convertor don't work

I am trying to develop an e-commerce website. To manage multi-currency, I would like to use webservice for automatic conversions. so I tried this webservice: http://www.webservicex.com/CurrencyConvertor.asmx?WSDL with this code :

     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()
            );
        } `

Unfortunately, the service returns me - 1 is there a problem with my code or it's the service that no longer works!!

you know another web service that is stable? thank you very much

Answers


m453h February 2016

Have a look at

https://openexchangerates.org/

http://fixer.io/

They both have a straight forward API you can integrate to.

Post Status

Asked in February 2016
Viewed 2,787 times
Voted 7
Answered 1 times

Search




Leave an answer