nusoap 怎么注册类中所有的函数单个的函数我会用,如果函数写在类中呢。

解决方案 »

  1.   

    类里面调用nusoap和单个函数没什么区别,例如:
    <?php
    require_once('nusoap.php');
    Class ExtSOAP {
    public $server;
    public $http_raw_post_data; function __construct(){
    $this->server = new soap_server();
    $this->server->register('hello');
    $this->http_raw_post_data = isset($HTTP_RAW_POST_DATA) ? $HTTP_RAW_POST_DATA : '';
    }

    function services() {
    $this->server->service($this->http_raw_post_data);
    }
    }// 类调用
    $obj = new ExtSOAP();
    $obj->services();
    ?>
      

  2.   

    不需要注册所有的函数。
    你做一个共用的入口函数。
    class myclass{
    //***********
    }
    function runApi($methodname,$parment){//方法名,参数数组
        $classname = "myclass";    call_user_func_array(array($classname, $methodname),$parment);
    }
      

  3.   

    用zendstdio可以生成wsdl我正在使用《Csdn收音机》第一时间获取最新动态!