Sophie

Sophie

distrib > Mageia > 7 > armv7hl > media > core-release > by-pkgid > b3ff9d3c9422e3118b7a64b8aa395b87 > files > 95

perl-SOAP-Lite-1.270.0-1.mga7.noarch.rpm

#!/usr/bin/perl -w
#!d:\perl\bin\perl.exe

# -- SOAP::Lite -- soaplite.com -- Copyright (C) 2001 Paul Kulchenko --

# that's OO call, so first parameter is scalar (class name)

use Inline C => <<ENDC;
SV* greet(SV* o, char* x) { newSVpvf("Hello, %s world", x); }
ENDC

use SOAP::Transport::HTTP;

$SIG{PIPE} = $SIG{INT} = 'IGNORE'; # don't want to die on 'Broken pipe' or Ctrl-C

my $daemon = SOAP::Transport::HTTP::Daemon
  -> new (LocalAddr => 'localhost', LocalPort => 81)
  -> dispatch_to('greet')
;
print "Contact to SOAP server at ", $daemon->url, "\n";
$daemon->handle;

# you can see the result with:
#
# % perl SOAPsh.pl http://localhost:81/
# > greet('cruel')
#