[SOAP] WSDL error can someone help

From: Date: Sun, 20 Jan 2008 19:55:03 +0000
Subject: [SOAP] WSDL error can someone help
Groups: php.soap 
Request: Send a blank email to php-soap+get-2724@lists.php.net to get a copy of this message
Hi all, I'm getting a strange error when using nusoap with php, both host and client are on a local machine. Here is the server code. <?php function getStockQuote($symbol) { mysql_connect('localhost','user','password'); mysql_select_db('database'); $query = "SELECT stock_price FROM stockprices " . "WHERE stock_symbol = '$symbol'"; $result = mysql_query($query); $row = mysql_fetch_assoc($result); return $row['stock_price']; } require('nusoap.php'); $server = new soap_server(); $server->configureWSDL('stockserver', 'urn:stockquote'); $server->register("getStockQuote", array('symbol' => 'xsd:string'), array('return' => 'xsd:decimal'), 'urn:stockquote', 'urn:stockquote#getStockQuote'); $HTTP_RAW_POST_DATA = isset($HTTP_RAW_POST_DATA) ? $HTTP_RAW_POST_DATA : ''; $server->service($HTTP_RAW_POST_DATA); ?> When I connect to this via a web browser I can view the wsdl for the service and all seems grand. This is the client code. <?php require_once('nusoap.php'); $c = new soapclient('http://localhost:80/distribsys/newtest/server.php'); $stockprice = $c->call('getStockQuote',array('symbol' => 'ABC')); echo "The stock price for 'ABC' is $stockprice."; ?> When i connect I get this error Fatal error: Uncaught SoapFault exception: [WSDL] SOAP-ERROR: Parsing WSDL: Couldn't load from 'http://localhost:80/distribsys/newtest/server.php' in /var/www/distribsys/newtest/client.php:4 Stack trace: #0 /var/www/distribsys/newtest/client.php(4): SoapClient->SoapClient('http://localhos...') #1 {main} thrown in /var/www/distribsys/newtest/client.php on line 4 I cannot solve this, I have looked all over the web for solutions and no luck, can anyone guess what could be potentially wrong with this, thanks very much in advance, any help is greatly appreciated. -- View this message in context: http://www.nabble.com/WSDL-error-can-someone-help-tp14985983p14985983.html Sent from the Php - Soap mailing list archive at Nabble.com.

« previous php.soap (#2724) next »