2 # Query the DB0SDX QSL server for a callsign
4 # Copyright (c) 2003 Dirk Koopman G1TLH
9 my ($self, $line) = @_;
10 my $call = $self->call;
14 return (1, $self->msg('e24')) unless $Internet::allow;
15 return (1, "SHOW/DB0SDX <callsign>, e.g. SH/DB0SDX ea7wa") unless $line && is_callsign($line);
16 my $target = 'dotnet.grossmann.com';
18 my $cmdprompt = '/query->.*$/';
23 $info = $t->open(Host => $target,
28 push @out, $self->msg('e18', 'DB0SDX Database server');
31 my $s = qq(<?xml version="1.0" encoding="utf-8"?>
32 <soap:Envelope xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xmlns:xsd="http://www.w3.org/2001/XMLSchema" xmlns:soap="http://schemas.xmlsoap.org/soap/envelope/">
34 <qslinfo xmlns="http://dotnet.grossmann.com/qslinfo">
35 <callsign>$line</callsign>
42 my $lth = length($s)+7;
44 dbg("db0sdx out: $s") if isdbg('db0sdx');
46 $t->print("POST /qslinfo/qslinfo.asmx HTTP/1.1");
47 $t->print("Host: dotnet.grossmann.com");
48 $t->print("Content-Type: text/xml; charset=utf-8");
49 $t->print("Content-Length: $lth");
50 $t->print("Connection: Close");
51 $t->print("SOAPAction: \"http://dotnet.grossmann.com/qslinfo/qslinfo\"");
57 while (my $result = eval { $t->getline(Timeout => 30) } || $@) {
59 push @out, $self->msg('e18', 'DB0SDX Server');
66 dbg("db0sdx in: $in") if isdbg('db0sdx');
69 Log('call', "$call: show/db0sdx $line");
72 my ($info) = $in =~ m|<qslinfoResult>([^<]*)</qslinfoResult>|;
73 my @in = split /[\r\n]/, $info if $info;
77 ($info) = $in =~ m|<faultstring>([^<]*)</faultstring>|;
78 push @out, $info if $info;
79 push @out, $self->msg('e3', 'DB0SDX', $line) unless @out;