我是新來的webservices, 我已經創建了一個基本的股市web服務,我已經成功地爲它創建了服務器腳本,並將其放置在我的服務器中,現在我還創建了一個clent腳本並訪問它hruogh相同的服務器..它有效嗎? boh文件可以從同一臺服務器上傳輸嗎?還是必須將它們放在不同的服務器中?如果是的話那麼Y?如果否,那麼爲什麼我會得到空白頁? 我正在使用nusoap庫進行webservice。Webservice錯誤
當我用我的cleint腳本從我的本地機器我得到這些錯誤
"Deprecated: Assigning the return value of new by reference is deprecated in D:\wamp\www\pranav_test\nusoap\lib\nusoap.php on line 6506
Fatal error: Class 'soapclient' not found in D:\wamp\www\pranav_test\stockclient.php on line 3"
stockserver.php在服務器
<?php
function getStockQuote($symbol) {
mysql_connect('localhost','root','******');
mysql_select_db('pranav_demo');
$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/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);
?>
stockclient.php
<?php
require_once('nusoap/lib/nusoap.php');
$c = new soapclient('http://192.168.1.20/pranav_test/stockserver.php');
$stockprice = $c->call('getStockQuote',
array('symbol' => 'ABC'));
echo "The stock price for 'ABC' is $stockprice.";
?>
請幫助。 ..
php無法加載文件nusoap.php,嘗試絕對路徑到您的nusoap/libnusoap.php文件。 – Alex 2010-04-29 06:44:13