Php ews Wrong Version

时间:2015-03-27 07:21:52

标签: php github exchange-server php-ews

我正在使用https://github.com/jamesiarmes/php-ews/wiki的php-ews脚本。如果我运行此脚本,我总是在浏览器中收到错误消息。它说

  

未收集例外:错误版本

有人知道该怎么办吗? (我使用config.inc include加载自动加载器并且它可以工作)

Exchange版本2010 SP1      

    #include("../include/all_inc.inc");

    $server = "******";
    $username="******";
    $password="*****";
    $version =ExchangeWebServices::VERSION_2010;

    $ews = new ExchangeWebServices($server, $username, $password, $version);


    $request = new EWSType_FindFolderType();
    $request->Traversal = EWSType_FolderQueryTraversalType::SHALLOW;
    $request->FolderShape = new EWSType_FolderResponseShapeType();
    $request->FolderShape->BaseShape = EWSType_DefaultShapeNamesType::ALL_PROPERTIES;

    // configure the view
    $request->IndexedPageFolderView = new EWSType_IndexedPageViewType();
    $request->IndexedPageFolderView->BasePoint = 'Beginning';
    $request->IndexedPageFolderView->Offset = 0;

    // set the starting folder as the inbox
    $request->ParentFolderIds = new EWSType_NonEmptyArrayOfBaseFolderIdsType();
    $request->ParentFolderIds->DistinguishedFolderId = new EWSType_DistinguishedFolderIdType();
    $request->ParentFolderIds->DistinguishedFolderId->Id = EWSType_DistinguishedFolderIdNameType::INBOX;

    // make the actual call
    $response = $ews->FindFolder($request);

    ?>

1 个答案:

答案 0 :(得分:2)

您应该使用Exchange 2010 SP1的显式版本常量。

这应该适合你:

$version = ExchangeWebServices::VERSION_2010_SP1;