altariamx2003
asked on
how to read an external wsdl file in php
I have this wsdl file : http://www.banxico.org.mx/DgieWSWeb/DgieWS?WSDL
I need to create a php program that catch in real time the exchange rate from USD dollar to MXN mexican pesos.
The wsdl file is from "banco de mexico".
From this file the exchange rate is on the element "tiposDeCambioBanxico":
With this code I try to read it
It seems to work but no matter what I do It always show me the following:
-------------------------- ---------- ---------- ---------- ---------- ---------- ---------- ---------- ---------
TIPOSDECAMBIO
false
false
Tipos de Cambio
2015-09-10 13:31:36.236
Banco de México
Subgerencia de Desarrollo de Sistemas
(01 55)52372678
Update
2015-09-10 13:31:36.236
-------------------------- ---------- ---------- ---------- ---------- ---------- --------
What Im doing wrong???
What else do I need to do catch the exchange rate(TIPOSDECAMBIO)
Best regards
Carlos Alvarez
I need to create a php program that catch in real time the exchange rate from USD dollar to MXN mexican pesos.
The wsdl file is from "banco de mexico".
From this file the exchange rate is on the element "tiposDeCambioBanxico":
<wsdl:operation name="tiposDeCambioBanxico">
<wsdlsoap:operation soapAction=""/>
<wsdl:input name="tiposDeCambioBanxicoRequest">
<wsdlsoap:body encodingStyle="http://schemas.xmlsoap.org/soap/encoding/" namespace="http://ws.dgie.banxico.org.mx" use="encoded"/>
</wsdl:input>
<wsdl:output name="tiposDeCambioBanxicoResponse">
<wsdlsoap:body encodingStyle="http://schemas.xmlsoap.org/soap/encoding/" namespace="http://ws.dgie.banxico.org.mx" use="encoded"/>
</wsdl:output>
</wsdl:operation>
With this code I try to read it
require_once('lib/nusoap.php');
$oSoapClient = new nusoap_client('http://www.banxico.org.mx:80/DgieWSWeb/DgieWS?WSDL','wsdl');
if ($sError = $oSoapClient->getError()) {
echo "No se pudo realizar la operación [" . $sError . "]";
die();
}
$respuesta = $oSoapClient->call("tiposDeCambioBanxico");
if ($oSoapClient->fault) {
echo 'No se pudo completar la operación';
die();
}else {
$sError = $oSoapClient->getError();
if ($sError) {
echo 'Error:' . $sError;
die();
}
echo "Funciono correctamente<br/>";
echo "<pre>";print_r($respuesta,false); echo "</pre>";
echo $respuesta["OBS_VALUE"];
}
It seems to work but no matter what I do It always show me the following:
--------------------------
TIPOSDECAMBIO
false
false
Tipos de Cambio
2015-09-10 13:31:36.236
Banco de México
Subgerencia de Desarrollo de Sistemas
(01 55)52372678
Update
2015-09-10 13:31:36.236
--------------------------
What Im doing wrong???
What else do I need to do catch the exchange rate(TIPOSDECAMBIO)
Best regards
Carlos Alvarez
ASKER CERTIFIED SOLUTION
membership
This solution is only available to members.
To access this solution, you must be a member of Experts Exchange.
Mr. Alvarez: Thanks for the points and thanks for using E-E. Best of luck with the project, ~Ray
ASKER
this will be really help me a lot
thanks
P.s. Thanks to take time to answer me