Warning: file_get_contents(/data/phpspider/zhask/data//catemap/1/php/297.json): failed to open stream: No such file or directory in /data/phpspider/zhask/libs/function.php on line 167

Warning: Invalid argument supplied for foreach() in /data/phpspider/zhask/libs/tag.function.php on line 1116

Notice: Undefined index: in /data/phpspider/zhask/libs/function.php on line 180

Warning: array_chunk() expects parameter 1 to be array, null given in /data/phpspider/zhask/libs/function.php on line 181
Php 带连字符的方法的Zend soap调用_Php_Zend Framework_Soap_Zend Soap - Fatal编程技术网

Php 带连字符的方法的Zend soap调用

Php 带连字符的方法的Zend soap调用,php,zend-framework,soap,zend-soap,Php,Zend Framework,Soap,Zend Soap,我使用Zend框架重写soap客户机文件 这是老办法。它正在工作 function getBassaService(){ global $service; $h="127.0.0.1"; $p="8000"; if($service==null){ $service = new SoapClient("/test/php/bassa.wsdl", array( "soap_version" => SOAP_1_2,

我使用Zend框架重写soap客户机文件

这是老办法。它正在工作

function getBassaService(){
    global $service;
    $h="127.0.0.1";
    $p="8000";

    if($service==null){
        $service = new SoapClient("/test/php/bassa.wsdl", array(
        "soap_version"   => SOAP_1_2,
        "trace"      => 1,
        "exceptions" => 1,
        "location" => "http://".$h.":".$p));
    }
    return $service;
}

function getAllDownloads(){
    global $service;
    $client = getService();
    try{
        $results = $client->__soapCall("list-all", array());
    }catch(SoapFault $e){
        print($e->faultstring);     
    }

    return $result;
}
这是我的新代码。我使用Zend_Soap_客户端

    const HOST = "127.0.0.1";       
    const PORT = "8095";

    protected $_client; 

    public function __construct()
    {           
        $this->_client = new Zend_Soap_Client(APPLICATION_PATH ."/services/bassa.wsdl",
        array(
            "soap_version" => SOAP_1_2,
            "uri" => "http://". self::HOST .":". self::PORT
            )
        );
    }

    public function getAllDownloads()
    {
        $result = $this->_client->list-all();
        return $result;
    }
我的soap服务器有
列出所有
方法。我希望对该方法进行soap调用。但出现了以下错误。因为方法名有连字符

Notice: Undefined property: Zend_Soap_Client::$list in /home/dinuka/workspace/testzend/application/services/SoapClient.php on line 57

Fatal error: Call to undefined function all() in /home/dinuka/workspace/testzend/application/services/SoapClient.php on line 57

我是怎么修好的。请帮帮我

奇怪。这应该行得通。这可能是ZF框架中的一个bug。也许它正在尝试将函数名转换为带有变量的驼峰大小写函数名

尝试通过调用以下命令直接使用magic函数:

$this->_client->__call('list-all', array('param1' => $param1))

奇怪。这应该行得通。这可能是ZF框架中的一个bug。也许它正在尝试将函数名转换为带有变量的驼峰大小写函数名

尝试通过调用以下命令直接使用magic函数:

$this->_client->__call('list-all', array('param1' => $param1))