xml - Unexpected element in result of EWS FindItem with GroupBy -
xml - Unexpected element in result of EWS FindItem with GroupBy -
i'm using ews (exchange web services) access info exchange 2013 test server. i'm doing using php (somewhat dated) php-ews repository: github-jamesiarmes-php-ews , newer , composer enabled version: github-deakin-php-ews
i can basic calls exchange service described in wiki 'jamesiarmes', ran in troubles when tried utilize groupby method: how to: perform grouped searches using ews in exchange
as can see in xml response how-to guide, <groups>
element should contain 0 or more <groupitems>
contain items (in case calendaritems). got test server <group>
elements in stead of <groupitems>
caused $response object incomplete.
the code used:
$request = new finditemtype(); $request->traversal = itemquerytraversaltype::shallow; $request->itemshape = new itemresponseshapetype(); $request->itemshape->baseshape = defaultshapenamestype::all_properties; // define time frame 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 folders $request->parentfolderids = new nonemptyarrayofbasefolderidstype(); $request->parentfolderids->folderid = new folderidtype(); $request->parentfolderids->folderid->id = $calendarfolderuid; // grouping events 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);
this var_dump()
$response
:
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) } } } }
i managed collect xml response using __getlastresponse()
(php docs) , found did wanted items, in <group>
element instead of <groupitems>
which cased soapclient homecoming empty object <groups>
element.
now i'm wondering problem lies:
is how-to guide outdated? didn't find reference<group>
element in other documentation ews, don't think issue. is exchange server using xml schema or plain weird? are php-ews schemas outdated? should fork 'deakin' repo eventual solution? i found way create work adjusting php-ews schemas, if problem test server, don't need bother making fork... i'll post current solution below also.
i appreciate input on this....
as mentioned, came solution don't know if worth forking php-ews repo.
i found similar problems on stackoverflow (soap client receiving empty stdclass), disabling soap cache didn't prepare problem. did notice disabling of cache needed solution work.
what ended doing changing types.xsd schema php-ews:
<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>
strangely didn't have alter of ewstypes classes, expected had alter $groupeditems
property of arrayofgroupeditemstype
$groups
, didn't seem case.
if don't improve solution, i'll fork php-ews repo , post here...
cheers
xml schema exchange-server ews php-ews
Comments
Post a Comment