zimbra-api / soap-api

Zimbra SOAP client in PHP language

Geek Repo:Geek Repo

Github PK Tool:Github PK Tool

Problem with Zimbra-Api

nsasit opened this issue · comments

Hello.
I install zimbra/soap-api and when I run the phpunit *, everything seems to be ok.
When I use this code :
$api = new \Zimbra\AdminFactory::instance('https://localhost:7071/service/admin/soap');,
I have a problem :
Parse error: syntax error, unexpected 'instance' (T_STRING), expecting variable (T_VARIABLE) or '$' in.

So I change it by :
$js = new \Zimbra\Enum\RequestFormat('js');$api = new \Zimbra\Admin\Http('https://<hostname>:7071/service/admin/soap/', $js);
but another problem :
Fatal error: Call to undefined method Zimbra\Soap\Client\Http::format() in.

Could you help me ?

Thanks

  • : php phpunit.phar --configuration vendor/zimbra/soap-api/phpunit.xml.dist --debug

The problem in the tutorial is that the path is incorrect :

$api = \Zimbra\Admin\AdminFactory::instance(

instead of

$api = \Zimbra\AdminFactory::instance(

With this config, I have another error :

Fatal error: Call to undefined method Zimbra\Soap\Client\Http::authToken() in

The first problem in the tutorial is that you cannot call "new" with a static method.

new \Zimbra\AdminFactory::instance('https://localhost:7071/service/admin/soap');

Hast to be:

\Zimbra\AdminFactory::instance('https://localhost:7071/service/admin/soap');