#!/usr/bin/perl -w ########################################################################### # imports ########################################################################### use Data::Dumper; use Date::Parse; use Encode; use SOAP::Lite; #use SOAP::Lite +trace; #print "used SOAP::Lite version is $SOAP::Lite::VERSION\n"; use strict; ########################################################################### # define constants and globals ########################################################################### use constant { # soap api namespace SOAP_URI => 'http://futureware.biz/mantisconnect', # soap api endpoint SOAP_PROXY => 'http://m.whdload.de/api/soap/mantisconnect.php', # soap api login details (must have admin access) SOAP_USER => 'administrator', SOAP_PASS => 'xxx', # mantis constants ALL_PROJECTS => 0, ACCESS_ANYBODY => 0, ACCESS_REPORTER => 25, ACCESS_DEVELOPER => 55, ACCESS_MANAGER => 70, }; # access the mantis api my $mantis = SOAP::Lite -> uri(SOAP_URI) -> proxy(SOAP_PROXY, options => {compress_threshold => 10000}); $mantis or die "could not construct soap:$!"; # get list of all registered users from mantis print " - getting mantis users\n"; { my ($response,$user,$acc,$nam,$ema,$usr); $response = $mantis -> mc_project_get_users(SOAP_USER, SOAP_PASS, ALL_PROJECTS, ACCESS_ANYBODY); $response or die "soap: mc_project_get_users failed:$!"; #&WriteFile('out.gz',$mantis->{'_transport'}->{'_proxy'}->{'_http_response'}->{'_content'}); #use Compress::Zlib; #$_ = Compress::Zlib::memGunzip($mantis->{'_transport'}->{'_proxy'}->{'_http_response'}->{'_content'}) or die "memGunzip:$gzerrno"; #s/>/>\n/g; #die $_; #delete $mantis->{'_transport'}->{'_proxy'}->{'_http_response'}->{'_content'}; #delete $mantis->{'_deserializer'}->{'_ids'}; #delete $mantis->{'_deserializer'}->{'_parser'}->{'_done'}; #die "mc_project_get_users failed:$!, dumping \$mantis\n" . &Dumper($mantis); $response->fault and die "soap: mc_project_get_users: (".$response->faultcode.") ".$response->faultstring; foreach $user (@{$response->result}) { # returns: 'email' 'real_name' 'name' 'id' #print Dumper($user); exit; } }