我编写的代码如下所示:
App::uses('AppController', 'Controller');
App::uses('CakeTime', 'Utility');
App::import('Vendor', 'Nusoap', array('file' => 'Nusoap' . DS . 'lib' . DS . 'nusoap.php'));
class ApiController extends AppController {
/**
* Controller name
*
* @var string
*/
public $name = 'Api';
public $uses = array();
function index() {
$server = new soap_server();
$server->configureWSDL("Testing WSDL ", "urn:Testing WSDL ", "http://localhost/test/api");
$server->register("gethelloworld", array("name" => "xsd:string"), array("return" => "xsd:string"), "urn:helloworld", "urn:helloworld#gethelloworld");
function gethelloworld($name) {
$myname = "My Name Is <b>" . $name . "</b>";
return $myname;
}
$HTTP_RAW_POST_DATA = isset($HTTP_RAW_POST_DATA) ? $HTTP_RAW_POST_DATA : '';
$server->service($HTTP_RAW_POST_DATA);
}
}
但每当我运行它时,我都会收到以下通知:
Notice (8): Undefined index: _transient [APP\Vendor\Nusoap\lib\nusoap.php, line 226]
我在这里遗漏了什么吗?以下是我致电http://localhost/test/api
答案 0 :(得分:0)
仔细检查您的文件和配置。使用您的设置(我正在使用CakePHP v2.4.0)我没有问题: