【发布时间】:2020-11-20 00:41:37
【问题描述】:
我正在使用php-ews 库(新版本)来显示我项目中用户的日历事件。用户可以在他们的个人资料中设置他们的 ms 交换帐户详细信息,然后在我的项目本身中使用日历。代码如下
$host = '{host_set_on_users_profile}';
$username = '{username_set_on_users_profile}';
$password = '{password_set_on_users_profile}';
$version = Client::VERSION_2016;
$client = new Client($host, $username, $password, $version);
$client->setTimezone($timezone);
// Build request
$request = new FindItemType();
// more request building code here
$response = $client->FindItem($request);
但我遇到了以下问题
[faultstring] => The specified server version is invalid.
原因是我使用了固定的 VERSION_2016 并且用户可以为该帐户设置任何版本的 ms Exchange。
那么有什么方法可以先根据主机、用户名和密码找出服务器版本吗?这样我就可以使用它来创建客户端对象
【问题讨论】:
标签: php soap exchange-server exchangewebservices php-ews