0

我已经编写了如下所示的代码:

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

截屏

4

1 回答 1

0

仔细检查您的文件和配置。使用您的设置(我使用的是 CakePHP v2.4.0)我没有问题:

在此处输入图像描述

于 2013-09-11T13:27:21.710 回答