我已经编写了如下所示的代码:
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