NAME WebService::Ares - Perl class to communication with ARES service. SYNOPSIS use WebService::Ares; my $obj = WebService::Ares->new(%parameters); my @commands = $obj->commands; my $error = $obj->error($clean); my $data_hr = $obj->get($command, $def_hr); my $xml_data = $obj->get_xml($command, $def_hr); DESCRIPTION ARES - "Administrativní registr ekonomických subjektů" is Czech information system of Ministry of Finance. METHODS "new(%parameters)" Constructor. * "agent" User agent setting. Default is 'WebService::Ares/$VERSION'. * "debug" Debug mode flag. Default is 0. "commands()" Get web service commands. Returns array of commands. "error($clean)" Get error. When $clean variable is present, cleans internal error variable. Returns string with error or undef. "get($command, $def_hr)" Get data for command '$command' and definitition defined in $dev_hr reference of hash. Possible definition keys are: - ic - company identification number. Returns reference to hash with data or undef as error. "get_xml($command, $def_hr)" Get XML data for command '$command' and definition defined in $dev_hr reference to hash. Possible definition keys are: - ic - company identification number. Returns string with XML data or undef as error. ERRORS get(): Method '%s' is unimplemented. get_xml(): Method '%s' is unimplemented. EXAMPLE1 # Pragmas. use strict; use warnings; # Modules. use Data::Printer; use WebService::Ares; # Arguments. if (@ARGV < 1) { print STDERR "Usage: $0 ic\n"; exit 1; } my $ic = $ARGV[0]; # Object. my $obj = WebService::Ares->new; # Get data. my $data_hr = $obj->get('standard', {'ic' => $ic}); # Print data. p $data_hr; # Output: # Usage: /tmp/8PICXQSYF3 ic # Output with (44992785) arguments: # \ { # address { # district "Brno-město", # num 196, # num2 1, # psc 60200, # street "Dominikánské náměstí", # town "Brno", # town_part "Brno-město", # town_urban "Brno-střed" # }, # create_date "1992-07-01", # firm "Statutární město Brno", # ic 44992785 # } EXAMPLE2 # Pragmas. use strict; use warnings; # Modules. use WebService::Ares; # Arguments. if (@ARGV < 1) { print STDERR "Usage: $0 ic\n"; exit 1; } my $ic = $ARGV[0]; # Object. my $obj = WebService::Ares->new; # Get data. my $data_xml = $obj->get_xml('standard', {'ic' => $ic}); # Print data. print $data_xml."\n"; # Output: # Usage: /tmp/8PICXQSYF3 ic # Output with (44992785) arguments: # # # # 1 # FREE # # # 9 # # ICO # # 3 # RES # # 1992-07-01 # 2014-08-18 # # 801 # # Statutární město Brno # 44992785 # # # 314885828 # 203 # Brno-město # Brno # Brno-město # Brno-střed # Dominikánské náměstí # 196 # 1 # 1 # 60200 # # 60 # 116 # 3702 # 582786 # 411582 # 550973 # 60200 # 22829 # 196 # 1 # 1 # 19095597 # 18945341 # 649906 # # # # NNAANANANNAANNNNNNNNPNNNANNNNN # # # EXAMPLE3 # Pragmas. use strict; use warnings; # Modules. use WebService::Ares; # Object. my $obj = WebService::Ares->new; # Get commands. my @commands = $obj->commands; # Print commands. print join "\n", @commands; print "\n"; # Output: # standard DEPENDENCIES Ares::Standard, Class::Utils, Error::Pure, HTTP::Request, LWP::UserAgent. SEE ALSO WebService::Ares::Standard Perl XML::Parser parser for Ares standard XML file. REPOSITORY AUTHOR Michal Špaček skim@cpan.org LICENSE AND COPYRIGHT © Michal Špaček 2009-2015 BSD 2-Clause License VERSION 0.02