【问题标题】:Codeigniter Nusoap ErrorCodeigniter Nusoap 错误
【发布时间】:2012-08-11 08:46:38
【问题描述】:

我是 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);
    }
?>

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

【问题讨论】:

  • 错误响应到底是什么?
  • 我使用了 Firefox SOA 客户端,我收到:“获取响应时出错”消息。

标签: codeigniter nusoap


【解决方案1】:

在 index() 函数中声明 hello 函数对我有用。但是声明 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, ';
}

}
 ?>

【讨论】:

    猜你喜欢
    • 2013-09-04
    • 1970-01-01
    • 1970-01-01
    • 1970-01-01
    • 2017-02-13
    • 2013-07-29
    • 1970-01-01
    • 1970-01-01
    • 1970-01-01
    相关资源
    最近更新 更多