-
Notifications
You must be signed in to change notification settings - Fork 23
/
Zapret.pm
63 lines (53 loc) · 954 Bytes
/
Zapret.pm
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
package Zapret;
require Exporter;
@ISA = qw/Exporter/;
@EXPORT = qw//;
use utf8;
use strict;
use SOAP::Lite;
use MIME::Base64;
my $VERSION='0.01';
sub new
{
my $class=shift;
my $URL=shift || die("URL not defined");
my $self={
service => SOAP::Lite->service($URL)
};
bless $self,$class;
return $self;
}
sub getLastDumpDate
{
my $this=shift;
return $this->{service}->getLastDumpDate;
}
sub getLastDumpDateEx
{
my $this=shift;
return $this->{service}->getLastDumpDateEx;
}
sub sendRequest
{
my $this=shift;
my $requestFile=shift;
my $signatureFile=shift;
open XMLREQ, $requestFile;
my $xmlreq = do { local $/ = undef; <XMLREQ>; };
close XMLREQ;
open XMLREQSIG, $signatureFile;
my $xmlreqsig = do { local $/ = undef; <XMLREQSIG>; };
close XMLREQSIG;
return $this->{service}->sendRequest(
$xmlreq,
$xmlreqsig,
"2.2"
);
}
sub getResult
{
my $this=shift;
my $code=shift;
return $this->{service}->getResult($code);
}
1;