0

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

未收集异常:错误版本

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

交换版本 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);

    ?>
4

1 回答 1

2

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

这应该为你做:

$version = ExchangeWebServices::VERSION_2010_SP1;

于 2015-06-11T00:50:09.877 回答