1package TestSOAP;
2use strict;
3use warnings;
4
5use base qw(Exporter);
6our (@EXPORT_OK);
7@EXPORT_OK = qw(make_soap);
8
9sub make_soap {
10  my ($soap_uri, $soap_proxy) = @_;
11  unless (eval { require SOAP::Lite }) {
12    print STDERR "SOAP::Lite is unavailable to make remote call\n";
13    return;
14  }
15
16  return SOAP::Lite
17    ->uri($soap_uri)
18      ->proxy($soap_proxy,
19              options => {compress_threshold => 10000})
20        ->on_fault(sub { my($soap, $res) = @_;
21                         print STDERR "SOAP Fault: ",
22                           (ref $res ? $res->faultstring
23                                     : $soap->transport->status),
24                           "\n";
25                         return undef;
26                       });
27}
28
291;
30