[OT] Struggling with EWS::Client

Chisel chisel at chizography.net
Fri Nov 14 12:14:37 GMT 2014


I have an idea for a side-project, but because I hate myself it
involves trying to use information held in an Exchange Calendar.

Being the most up to date, I've tried using EWS::Client [I've tried
other modules, but they all dislike me too]. The version I'm using is
1.143070

I just can't get over the first hurdle.


➔ cat owa.pl
#!/usr/bin/env perl
use strict;
use warnings;

use Test::More;

use EWS::Client;
use DateTime;

my $ews = EWS::Client->new({
    server      => '<hostname from OWA>',
    username    => 'c.wright',
    #set in $ENV{EWS_PASS}
    use_negotiated_auth => 1,
});
isa_ok($ews,'EWS::Client');

my $cal = $ews->calendar;
isa_ok($cal, 'EWS::Client::Calendar');

my $entries = $cal->retrieve({
    start => DateTime->now(),
    end   => DateTime->now()->add( months => 3 ),
});
isa_ok($entries, 'EWS::Calendar::ResultSet');

done_testing;


Gives:

 perl owa.pl
ok 1 - An object of class 'EWS::Client' isa 'EWS::Client'
ok 2 - An object of class 'EWS::Client::Calendar' isa 'EWS::Client::Calendar'
Can't use an undefined value as an ARRAY reference at
/Users/c.wright/perl5/perlbrew/perls/perl-5.20.0/lib/site_perl/5.20.0/EWS/Calendar/Role/RetrieveWithinWindow.pm
line 12.
# Tests were run but no plan was declared and done_testing() was not seen.
# Looks like your test exited with 255 just after 2.


The line with the error is here:
https://metacpan.org/source/OLIVER/EWS-Client-1.143070/lib/EWS/Calendar/Role/RetrieveWithinWindow.pm#L12

Using Data::Printer on $kind and $response give me:

➔ perl owa.pl
ok 1 - An object of class 'EWS::Client' isa 'EWS::Client'
ok 2 - An object of class 'EWS::Client::Calendar' isa 'EWS::Client::Calendar'
"FindItem"
\ {}
Can't use an undefined value as an ARRAY reference ...


I've tried stepping through with the debugger on previous attempts,
but didn't have much luck.


Has anyone had any success or experience with this module.

Or know of a simple, reliable way to query calendar information in an
Exchange server?


Thanks all!
-- 
Chisel
e: chisel at chizography.net
w: http://chizography.net



More information about the london.pm mailing list