- try {
- $response = $this->_httpClient->setUri(
- $url
- )->setConfig(
- [
- 'timeout' => $this->_scopeConfig->getValue(
- 'currency/webservicex/timeout',
- \Magento\Store\Model\ScopeInterface::SCOPE_STORE
- ),
- ]
- )->request(
- 'GET'
- )->getBody();
-
- $xml = simplexml_load_string($response, null, LIBXML_NOERROR);
- if (!$xml) {
- $this->_messages[] = __('We can\'t retrieve a rate from %1.', $url);
- return null;
- }
- return (double)$xml;
- } catch (\Exception $e) {