PHP SOAP Problem
Posted: Thu Jan 12, 2006 4:16 pm
Hello,
I'm just getting stated with SOAP and I'm trying to basically query a web service in order to get up to date currency conversion rates...I found this service:
BindingPoint.com
but I can't seem to get it to work...my result always comes out to be zero.....and I know its doing something cuz if i play w/ the parameters in the function 'call', the fault will complain.....btw, I'm using nuSOAP from sourceforge...here is my code:
i know their service is working cuz you can test it on their site....any ideas?
Thanks in advance
I'm just getting stated with SOAP and I'm trying to basically query a web service in order to get up to date currency conversion rates...I found this service:
BindingPoint.com
but I can't seem to get it to work...my result always comes out to be zero.....and I know its doing something cuz if i play w/ the parameters in the function 'call', the fault will complain.....btw, I'm using nuSOAP from sourceforge...here is my code:
Code: Select all
require('../includes/soap/nusoap.php');
$host = "www.webservicex.net";
$soap_action = "http://www.webserviceX.NET/ConversionRate";
$operation = "ConversionRate";
$param = array('FromCurrency' => 'EUR', 'ToCurrency' => 'USD');
$access_point = "http://www.webservicex.net/CurrencyConvertor.asmx?wsdl";
$c = new soapclient($access_point);
$conversion = $c->call($operation ,$param, $host, $soap_action);
if($c->fault){
echo "FAULT: <p>Code: {" . $c->faultcode . "} <br />";
echo "String: {" . $c->faultstring . "} </p>";
}
echo "conversion=" . $conversion . "<br>\n";Thanks in advance