Pregunta

Reescribo el archivo del cliente SOAP usando Zend Framework.

Este es un método antiguo. está funcionando.

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;
}

Este es mi nuevo código. Yo uso zend_soap_client.

    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;
    }

Mi servidor SOAP tiene list-all método. Quiero una llamada de jabón a ese método. Pero ha ocurrido el siguiente error. Porque el nombre del método tiene guión.

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

Cómo lo arreglé. Por favor, ayúdame.

¿Fue útil?

Solución

extraño. Eso debería funcionar. Puede ser AA Bug en ZF Framework. Tal vez está tratando de convertir el nombre de la función en un nombre de función de caso de camello con variables.

Intente usar la función mágica directamente llamando:

$this->_client->__call('list-all', array('param1' => $param1))
Licenciado bajo: CC-BY-SA con atribución
No afiliado a StackOverflow
scroll top