PHP SOAP Problem

PHP programming forum. Ask questions or help people concerning PHP code. Don't understand a function? Need help implementing a class? Don't understand a class? Here is where to ask. Remember to do your homework!

Moderator: General Moderators

Post Reply
WeezelDS
Forum Newbie
Posts: 12
Joined: Mon Feb 28, 2005 10:22 pm

PHP SOAP Problem

Post by WeezelDS »

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:

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";
i know their service is working cuz you can test it on their site....any ideas?

Thanks in advance
WeezelDS
Forum Newbie
Posts: 12
Joined: Mon Feb 28, 2005 10:22 pm

Post by WeezelDS »

*bump*
Post Reply