zimbra-api / soap-api

Zimbra SOAP client in PHP language
BSD 3-Clause "New" or "Revised" License
63 stars 49 forks source link

Problem with Zimbra-Api #3

Closed nsasit closed 8 years ago

nsasit commented 9 years ago

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

nsasit commented 9 years ago

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

MaizerGomes commented 8 years ago

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');