我是Codeigniter和SOAP web服务的新手。我在下面得到了错误响应。
<?php
class Webservice extends CI_Controller {
var $ns = "http://localhost/website/webservice";
public function __construct()
{
parent::__construct();
$this->load->library("Nusoap_lib");
$this->server = new soap_server();
// Initialize WSDL support
$this->server->configureWSDL('hellowsdl', 'urn:hellowsdl');
// Register the method to expose
$this->server->register('hello');
// Define the method as a PHP function
}
public function hello() {
return 'Hello, ';
}
function index()
{
$this->server->service($this->ns);
}
?>请任何人帮助我,我的代码中有什么问题。谢谢。
发布于 2015-03-30 13:19:58
在index()函数中声明hello函数,这对我很有效。但是声明out of index()函数给我带来了问题。
<?php
class Webservice extends CI_Controller {
var $ns = "http://localhost/website/webservice";
public function __construct()
{
parent::__construct();
$this->load->library("Nusoap_lib");
$this->server = new soap_server();
// Initialize WSDL support
$this->server->configureWSDL('hellowsdl', 'urn:hellowsdl');
// Register the method to expose
$this->server->register('hello');
// Define the method as a PHP function
}
function index()
{
$this->server->service($this->ns);
public function hello() {
return 'Hello, ';
}
}
?>https://stackoverflow.com/questions/11913298
复制相似问题