Page 1 of 1

nusoap

Posted: Tue Mar 01, 2005 6:43 pm
by dannymc1983
hi im trying to run a nusoap client but every client i have used has returned no information from a server. could somebody try running this code and let me know if they are getting any result? im getting nothing and the code is fine (i hope!!)

Code: Select all

<?php
// include the SOAP classes
require_once('nusoap.php');
// define parameter array (ISBN number)
$param = array('isbn'=>'0385503954');
// define path to server application
$serverpath ='http://services.xmethods.net:80/soap/servlet/rpcrouter';
//define method namespace
$namespace="urn:xmethods-BNPriceCheck";
// create client object
$client = new soapclient($serverpath);
// make the call
$price = $client->call('getPrice',$param,$namespace);
// if a fault occurred, output error info
if (isset($fault)) &#123;
        print "Error: ". $fault;
        &#125;
else if ($price == -1) &#123;
        print "The book is not in the database.";
&#125; else &#123;
        // otherwise output the result
        print "The price of book number ". $param&#1111;isbn] ." is $". $price;
        &#125;
// kill object
unset($client);
?>

Posted: Tue Mar 01, 2005 10:38 pm
by smpdawg
I tried a test site, it didn't work. I tried your code. It didn't work. I made a different version to get eBay prices and it also didn't work. No errors, just no information. For now I will assume that their test server is not returning valid data.

Posted: Wed Mar 02, 2005 11:03 am
by dannymc1983
thanks for the reply. i actually got it working. the problem was that i wasnt setting my proxy server address. took me a while to figure it out...

Posted: Wed Mar 02, 2005 11:06 am
by smpdawg
Really? I wasn't running a proxy and it still didn't work. I am going to try mine again...