Home  >  Article  >  Backend Development  >  nusoap 如何注册类中所有的函数

nusoap 如何注册类中所有的函数

WBOY
WBOYOriginal
2016-06-13 10:05:50797browse

nusoap 怎么注册类中所有的函数
nusoap 怎么注册类中所有的函数

单个的函数我会用,如果函数写在类中呢。

------解决方案--------------------
类里面调用nusoap和单个函数没什么区别,例如:

PHP code
<?phprequire_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();?><br><font color="#e78608">------解决方案--------------------</font><br>学习了<br><font color="#e78608">------解决方案--------------------</font><br>不需要注册所有的函数。<br>你做一个共用的入口函数。<br>class myclass{<br>//***********<br>}<br>function runApi($methodname,$parment){//方法名,参数数组<br>   $classname = "myclass";<br><br>   call_user_func_array(array($classname, $methodname),$parment);<br>}<br><font color="#e78608">------解决方案--------------------</font><br>用PHP里的soap就可以<br><font color="#e78608">------解决方案--------------------</font><br>用zendstdio可以生成wsdl<br><br>我正在使用《Csdn收音机》第一时间获取最新动态!<div class="clear">
                 
              
              
        
            </div>
Statement:
The content of this article is voluntarily contributed by netizens, and the copyright belongs to the original author. This site does not assume corresponding legal responsibility. If you find any content suspected of plagiarism or infringement, please contact admin@php.cn