2014-10-22 1 views
0

EWS (Exchange Web Services)를 사용하여 Exchange 2013 테스트 서버의 데이터에 액세스하고 있습니다. github-jamesiarmes-php-ews 및 새로운 작곡가 활성화 버전 : 나는 (다소 일자) PHP-EWS 저장소로 사용하여이 PHP를하고 있어요 github-deakin-php-ewsEWS FindItem과 GroupBy의 결과에 예기치 않은 요소가 있습니다.

'jamesiarmes에서 위키에 설명 된대로 내 Exchange 서비스에 대한 기본 통화를 할 수있는 나는 GROUPBY 방법을 사용하려고 할 때 ',하지만 일부 문제에 달렸다 : 당신이에서 XML 응답에서 볼 수 있듯이 How to: Perform grouped searches by using EWS in Exchange

을 어떻게에 일반적으로 <Groups> 요소가 포함되어 있어야합니다, 안내 0 개 이상의 <GroupItems> 사람은 것 내 경우에는 CalendarItems 항목을 포함하십시오. 하지만 테스트 서버에서 얻은 내용은 이라는 요소 대신 <GroupItems>인데 $ response 객체가 불완전합니다.

내가 사용하는 코드 : 나는 __getLastResponse() (PHP docs)를 사용하여 XML 응답을 수집 관리하고 모든 원을 얻었다 발견

object(stdClass)#685 (1) { 
    ["ResponseMessages"]=> 
    object(stdClass)#690 (1) { 
    ["FindItemResponseMessage"]=> 
    object(stdClass)#714 (3) { 
     ["ResponseCode"]=> 
     string(7) "NoError" 
     ["ResponseClass"]=> 
     string(7) "Success" 
     ["RootFolder"]=> 
     object(stdClass)#715 (3) { 
     ["Groups"]=> 
     object(stdClass)#716 (0) { 
     } 
     ["IncludesLastItemInRange"]=> 
     bool(true) 
     ["TotalItemsInView"]=> 
     int(4) 
     } 
    } 
    } 
} 

: 이것은

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

var_dump()$response에서 항목에 있지만 <GroupItems> 대신 <Group> 요소에 <Groups> 요소의 빈 개체를 반환하도록 SoapClient를 처리했습니다. 문제가 자리하고있는 곳

지금 궁금 해요 :

  1. 이가 어떻게-하는 오래된 가이드? EWS의 다른 문서에서이 <Group> 요소에 대한 참조를 찾지 못 했으므로 문제가 아닌 것 같습니다.
  2. 내 Exchange 서버가 다른 XML 스키마를 사용하고 있습니까?
  3. php-ews 스키마가 구식입니까? 최종 솔루션으로 '디킨 (deakin)'레포를 포크해야할까요?

나는 이미 PHP는-EWS 스키마를 조절하여 작동하게 할 수있는 방법을 찾았지만 문제가 내 테스트 서버 인 경우, 내가 게시거야 ... 포크을 귀찮게 할 필요가 없습니다 내 현재 솔루션도 아래에 있습니다. 내가 언급 한 바와 같이

내가 여기에 대한 입력을 부탁드립니다

....

답변

0

, 나는 해결책을 들어 왔지만는 PHP-EWS의 REPO를 분기 가치가 있는지 모르겠어요.

StackOverflow (SOAP Client receiving empty stdclass)에서 비슷한 문제가 발견되었지만 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 클래스 중 하나를 변경하지 않았다을, 나는 내가 $GroupedItems을 변경했다 예상 속성은 ArrayOfGroupedItemsType에서 $Groups이지만 실제로 그렇지는 않습니다.

내가 더 나은 솔루션을 얻지 않는 경우에, 나는 PHP가 EWS의 REPO 포크와 여기에 게시거야 ...

건배

관련 문제