Skip to content

Instantly share code, notes, and snippets.

@rodrigocabraln
Forked from MaskeZen/cotizacionBCU.php
Created May 19, 2021 14:45
Show Gist options
  • Save rodrigocabraln/f45cb07ec2597810d57b13b621714fb3 to your computer and use it in GitHub Desktop.
Save rodrigocabraln/f45cb07ec2597810d57b13b621714fb3 to your computer and use it in GitHub Desktop.
Cotización del BCU WS
<?php
getCotizacionesWS();
function getCotizacionesWS(){
$context = [
"ssl" => [
"verify_peer" => FALSE,
"verify_peer_name" => FALSE,
'crypto_method' => STREAM_CRYPTO_METHOD_TLS_CLIENT
]
];
$options = [
'cache_wsdl' => WSDL_CACHE_NONE,
'stream_context' => stream_context_create($context)
];
$params = [
'Entrada' => [
'FechaDesde' => '2017-10-17',
'FechaHasta' => '2017-10-17',
'Grupo' => 2,
'Moneda' => ['item' => 2225]
]
];
$client = new SoapClient('https://cotizaciones.bcu.gub.uy/wscotizaciones/servlet/awsbcucotizaciones?wsdl', $options);
$response = $client->Execute($params);
print_r($response->Salida->datoscotizaciones);
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment