[text]Fatal error: Uncaught SoapFault exception: [WSDL] SOAP-ERROR: Parsing WSDL: Couldn't load from 'http://localhost/webservices/stockserver.php' : Premature end of data in tag html line 2 in E:\xampp\htdocs\webservices\client.php:3 Stack trace: #0 E:\xampp\htdocs\webservices\client.php(3): SoapClient->SoapClient('http://localhos...') #1 {main} thrown in E:\xampp\htdocs\webservices\client.php on line 3[/text]
The server side code is:
Code: Select all
<?php
function getStockQuote($symbol) {
mysql_pconnect('localhost','root','Delphi00');
mysql_select_db('test');
$query = "SELECT stock_price FROM stockprices "
. "WHERE stock_symbol = '$symbol'";
$result = mysql_query($query);
$row = mysql_fetch_assoc($result);
return $row['stock_price'];
}
require('lib/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);
?>Code: Select all
<?php
require_once('lib/nusoap.php');
$c = new soapclient('http://localhost/webservices/stockserver.php');
$stockprice = $c->call('getStockQuote', array('symbol' => 'ABC'));
echo "The stock price for 'ABC' is $stockprice.";
?>Any ideas besides downgrading my XAMPP/PHP version?
Thanks!