atitthaker Posted November 3, 2006 Share Posted November 3, 2006 Hi,I am implementing XML-RPC using PHP and my code are as given below.Server Code:<?include("xmlrpc.inc");include("xmlrpcs.inc");function stax($ammount){ //$ammount=$par->getParam(0); //$ammount=$ammount->scalarval(); $ammount=547; $taxcalc=($ammount*12)/100; print_r(new xmlrpcresp(new xmlrpcval($taxcalc,"string"))); return new xmlrpcresp(new xmlrpcval($taxcalc,"string"));}stax(547);//$server=new xmlrpc_server(array("taxcalc.stax"=>array("function"=>"stax")));?>and my client code is:<?phpinclude("xmlrpc.inc");$ammount="547.00";$format=new xmlrpcmsg('taxcalc.stax',array(new xmlrpcval($ammount,"double")));$client=new xmlrpc_client("/TestAtitWsXmlRpcClient.php","localhost",80);$request=$client->send($format);print_r($request);$value=$request->value();print($val->scalarval());?>As u can see, it is simply manipulating the number and giving the response.[b]This code is giving me following error:[/b]Not FoundThe requested URL /TestAtitWsXmlRpcClient.php was not found on this server.--------------------------------------------------------------------------------Apache/2.0.46 (Red Hat) Server at localhost Port 80) Fatal error: Call to a member function scalarval() on a non-object in /var/www/html/trainingweb/modules/test/TestAtitWsXmlRpcClient.php on line 9I am unable to get the problem as I dont know much abt XML-RPC and the place I got code from has not given enough desc.Please do the needful.ThanksAtit Thaker. Link to comment https://forums.phpfreaks.com/topic/26027-xml-rpc-implementation/ Share on other sites More sharing options...
Daniel0 Posted November 3, 2006 Share Posted November 3, 2006 Well, it seems like apparently need a file. Link to comment https://forums.phpfreaks.com/topic/26027-xml-rpc-implementation/#findComment-118986 Share on other sites More sharing options...
atitthaker Posted November 3, 2006 Author Share Posted November 3, 2006 How can I attach file here???I am unable to do so.And the code I have given is the only code contained in the file. There is nothing else in the files.Plz do the needful.Thanks Link to comment https://forums.phpfreaks.com/topic/26027-xml-rpc-implementation/#findComment-119066 Share on other sites More sharing options...
atitthaker Posted November 13, 2006 Author Share Posted November 13, 2006 I found the solution for the problem. I needed to process Request Object correctly.I found this link useful. It may help someone else:http://phpxmlrpc.sourceforge.net/doc-2/Thanks and Regards,Atit Thaker Link to comment https://forums.phpfreaks.com/topic/26027-xml-rpc-implementation/#findComment-123842 Share on other sites More sharing options...
Recommended Posts
Archived
This topic is now archived and is closed to further replies.