首页
学习
活动
专区
圈层
工具
发布
社区首页 >问答首页 >Codeigniter Nusoap错误

Codeigniter Nusoap错误
EN

Stack Overflow用户
提问于 2012-08-11 16:46:38
回答 1查看 728关注 0票数 0

我是Codeigniter和SOAP web服务的新手。我在下面得到了错误响应。

代码语言:javascript
复制
<?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);
    }
?>

请任何人帮助我,我的代码中有什么问题。谢谢。

EN

回答 1

Stack Overflow用户

发布于 2015-03-30 13:19:58

在index()函数中声明hello函数,这对我很有效。但是声明out of index()函数给我带来了问题。

代码语言:javascript
复制
<?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, ';
}

}
 ?>
票数 0
EN
页面原文内容由Stack Overflow提供。腾讯云小微IT领域专用引擎提供翻译支持
原文链接:

https://stackoverflow.com/questions/11913298

复制
相关文章

相似问题

领券
问题归档专栏文章快讯文章归档关键词归档开发者手册归档开发者手册 Section 归档