File: inline.daemon

package info (click to toggle)
libsoap-lite-perl 0.712-2
  • links: PTS, VCS
  • area: main
  • in suites: squeeze
  • size: 1,740 kB
  • ctags: 831
  • sloc: perl: 10,860; xml: 90; makefile: 23; cs: 16
file content (27 lines) | stat: -rw-r--r-- 665 bytes parent folder | download | duplicates (7)
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
#!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')
#