我正在尝试开始使用 SOAP,我正在关注本教程: http: //www.codewalkers.com/c/a/Miscellaneous/Using-SOAP-with-PHP/3/
据我所知,我已经安装了我需要的所有东西。
soap
Soap Client enabled
Soap Server enabled
Directive Local Value Master Value
soap.wsdl_cache 1 1
soap.wsdl_cache_dir /tmp /tmp
soap.wsdl_cache_enabled 1 1
soap.wsdl_cache_limit 5 5
soap.wsdl_cache_ttl 86400 86400
当我尝试运行以下代码时,出现以下错误
<?php
function getStockQuote($symbol) {
mysql_connect("localhost", "username", "password");
mysql_select_db('captainc_general');
$query = "SELECT stock_price FROM stockprices "
. "WHERE stock_symbol = '$symbol'";
$result = mysql_query($query);
$row = mysql_fetch_assoc($result);
return $row['stock_price'];
}
require_once('nusoap.php'); //use the nusoap library
$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);
?>
警告:require_once(nusoap.php) [function.require-once]:无法打开流:第 17 行的 /home/captainc/public_html/soap/soaptest.php 中没有这样的文件或目录
致命错误:require_once() [function.require]:无法在 /home/captainc/public_html 中打开所需的 'nusoap.php' (include_path='.:/usr/lib/php:/usr/local/lib/php') /soap/soaptest.php 第 17 行
任何人都知道我需要做些什么来对此进行排序?