Xml EWS FindItem与GroupBy的结果中存在意外元素

Xml EWS FindItem与GroupBy的结果中存在意外元素,xml,schema,exchange-server,exchangewebservices,php-ews,Xml,Schema,Exchange Server,Exchangewebservices,Php Ews,我正在使用EWS Exchange Web服务从Exchange 2013测试服务器访问数据。我使用PHP和一些过时的PHP ews repository:以及更新的、支持编写器的版本: 我可以从“jamesiarmes”对我的Exchange服务进行wiki中描述的基本调用,但在尝试使用GroupBy方法时遇到了一些问题: 正如您在How to guide的XML响应中所看到的,通常该元素应该包含零个或多个元素,然后在my case CalendarItems中包含这些项目。但我从测试服务器得

我正在使用EWS Exchange Web服务从Exchange 2013测试服务器访问数据。我使用PHP和一些过时的PHP ews repository:以及更新的、支持编写器的版本:

我可以从“jamesiarmes”对我的Exchange服务进行wiki中描述的基本调用,但在尝试使用GroupBy方法时遇到了一些问题:

正如您在How to guide的XML响应中所看到的,通常该元素应该包含零个或多个元素,然后在my case CalendarItems中包含这些项目。但我从测试服务器得到的是元素,而不是导致$response对象不完整的元素

我使用的代码是:

$request = new FindItemType();
$request->Traversal = ItemQueryTraversalType::SHALLOW;
$request->ItemShape = new ItemResponseShapeType();
$request->ItemShape->BaseShape = DefaultShapeNamesType::ALL_PROPERTIES;

// Define the time frame to load calendar items
$request->CalendarView = new CalendarViewType();
$request->CalendarView->StartDate = '2014-01-12T15:18:34+03:00';
$request->CalendarView->EndDate = '2015-01-12T15:18:34+03:00';

// Find events from a certain folders
$request->ParentFolderIds = new NonEmptyArrayOfBaseFolderIdsType();
$request->ParentFolderIds->FolderId = new FolderIdType();
$request->ParentFolderIds->FolderId->Id = $calendarFolderUID;

// Group the events by date
$request->GroupBy = new GroupByType();
$request->GroupBy->Order = 'Ascending';
$request->GroupBy->FieldURI = new FieldURIOrConstantType();
$request->GroupBy->FieldURI->FieldURI = 'calendar:Start';
$request->GroupBy->AggregateOn = new AggregateOnType();
$request->GroupBy->AggregateOn->Aggregate = 'Minimum';
$request->GroupBy->AggregateOn->FieldURI = new FieldURIOrConstantType();
$request->GroupBy->AggregateOn->FieldURI->FieldURI = 'calendar:End';

$response = $this->soapService->FindItem($request);
这是$response的var_转储:

我设法使用_getLastResponse收集XML响应,发现它确实获得了所有想要的项,但在元素中,而不是在元素中,这使SoapClient为元素返回了一个空对象

现在我想知道问题出在哪里:

《如何指导》是否过时了?我在EWS的其他文档中没有找到任何对该元素的引用,因此我认为这不是问题所在。 我的Exchange服务器使用的是另一个XML架构还是很奇怪? php ews模式是否过时?我应该用最终的解决方案来解决“迪肯”回购协议吗? 我已经找到了一种通过调整PHPEWS模式使其工作的方法,但是如果问题是我的测试服务器,我不需要费心制作一个fork。。。我也将在下面发布我当前的解决方案


我将非常感谢您在这方面的任何意见……

正如我所提到的,我提出了一个解决方案,但我不知道是否值得分叉php ews回购

我在StackOverflow上发现了类似的问题,但仅仅禁用SOAP缓存显然并不能解决问题。然而,我确实注意到,禁用缓存是我的解决方案工作所必需的

我最后做的是从php ews更改types.xsd模式:

  <xs:complexType name="ArrayOfGroupedItemsType">
    <xs:choice>
      <xs:element name="Group" type="t:GroupedItemsType" minOccurs="0" maxOccurs="unbounded"/>
      <xs:element name="GroupedItems" type="t:GroupedItemsType" minOccurs="0" maxOccurs="unbounded"/>
    </xs:choice>
  </xs:complexType>
奇怪的是,我不必更改任何EWSTypes类,我希望我必须将ArrayOfGroupedItemsType的$GroupedItems属性更改为$Groups,但事实似乎并非如此

如果我没有更好的解决方案,我会把php ews repo放到这里

干杯

  <xs:complexType name="ArrayOfGroupedItemsType">
    <xs:choice>
      <xs:element name="Group" type="t:GroupedItemsType" minOccurs="0" maxOccurs="unbounded"/>
      <xs:element name="GroupedItems" type="t:GroupedItemsType" minOccurs="0" maxOccurs="unbounded"/>
    </xs:choice>
  </xs:complexType>