Calling soap webservice fro php

require_once(‘nusoap.php’);

$wsdl=“http://www.webservicex.net/CurrencyConvertor.asmx?WSDL”;

$client=new soapclient($wsdl, ‘wsdl’);

$param=array(‘Currency’=>‘INR’,‘Currency’=>‘USD’);

echo $client->__soapCall(‘ConversionRate’, $param);

Error getting like this
Fatal error: Cannot redeclare class soapclient

How to recover from this??:eek:

Is this is the method to call webservice from php??
Pls help

PHP has it’s own SoapClient class, which is clashing with nusoap’s SoapClass.

Might be better to use PHP’s class: http://www.php.net/soapclient

Not just that - your array ($param) is useless.
You can’t have two array keys with the same name as the latter one overwrites the former.

$param=array('Currency'=>'INR','Currency'=>'USD');
print_r($param);

Result:

Array
(
    [Currency] => USD
)