natxo has asked for the wisdom of the Perl Monks concerning the following question:

for Zimbra (https://www.zimbra.com/) there is an admin soap interface we can (ab)use to provision user accounts. Unsurprisingly there is a cpan module to help us with it: http://search.cpan.org/~plobbes/ZCS-Admin-0.07/. I am a bit puzzled though on how to get to the info:
use ZCS::Admin; + + my $zimbra = ZCS::Admin->new( + proxy => 'https://host.domain.tld7071/service/admin/soap/', name => 'admin', + password => 'password', + ); + + die ZCS::Admin->faultinfo($zimbra) if !$zimbra; + + my $accountinfo = $zimbra->getaccount( name => "username\@domain\.tld" + ); print $accountinfo, "\n";
This gives me an xml document like this:
<GetAccountResponse xmlns="urn:zimbraAdmin"><account name="user@domain +.tld" id="0cf5bb57-a2e8-4e3a-9c3a-ce40d13446db"><a n="zimbraPrefCalen +darReminderMobile">FALSE</a><a n="zimbraPrefIMLogChats">TRUE</a><a n= +"zimbraDeviceLockWhenInactive">FALSE</a><a n="zimbraPrefFileSharingAp +plication">briefcase</a><a n="zimbraPrefCalendarWorkingHours">1:N:080 +0:1700,2:Y:0800:1700,3:Y:0800:1700,4:Y:0800:1700,5:Y:0800:1700,6:Y:08 +00:1700,7:N:0800:1700</a><a n="zimbraFeatureOutOfOfficeReplyEnabled"> +TRUE</a><a n="zimbraPrefCalendarViewTimeInterval">1h</a><a n="zimbraP +refComposeFormat">html</a><a n="zimbraPrefIMNotifyStatus">TRUE</a><a +n="zimbraPrefLocale">nl</a><a n="zimbraQuotaWarnPercent">90</a><a n=" +givenName">User</a><a n="zimbraPrefIMReportIdle">TRUE</a><a n="zimbra +MailHost">host.domain.tld</a><a n="zimbraFeatureMailForwardingEnabled +">TRUE</a><a n="zimbraPrefSaveToSent">TRUE</a><a n="zimbraPrefDisplay +ExternalImages">FALSE</a><a n="zimbraPrefOutOfOfficeCacheDuration">7d +</a ...... </account></GetAccountResponse>
What is the best way to get to the info? Thanks in advance?

Replies are listed 'Best First'.
Re: soap parsing
by NetWallah (Canon) on Dec 02, 2015 at 00:24 UTC
    If you are asking how to parse the info - there are a TON of XML modules on CPAN, and I would recommend XML::Twig.

    Avoid the temptation to use XML::Simple - it has several issues(Search this site to find them) that will get you into trouble.

            Our business is run on trust. We trust you will pay in advance.

Re: soap parsing
by Anonymous Monk on Dec 02, 2015 at 00:31 UTC