【问题标题】:Php ews Wrong Versionphp ews 版本错误
【发布时间】:2015-06-11 08:50:09
【问题描述】:

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

未收集异常:版本错误

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

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

    ?>

【问题讨论】:

    标签: php github exchange-server php-ews


    【解决方案1】:

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

    这应该为你做:

    $version = ExchangeWebServices::VERSION_2010_SP1;

    【讨论】:

      猜你喜欢
      • 2015-05-27
      • 2014-01-26
      • 1970-01-01
      • 2019-06-15
      • 2018-03-10
      • 2017-01-06
      • 2011-07-27
      • 2020-07-24
      • 2020-07-06
      相关资源
      最近更新 更多