File: hello.pl

package info (click to toggle)
libsoap-wsdl-perl 3.004-2
  • links: PTS, VCS
  • area: main
  • in suites: bookworm, forky, sid, trixie
  • size: 2,600 kB
  • sloc: perl: 8,433; xml: 1,769; java: 19; makefile: 15
file content (26 lines) | stat: -rw-r--r-- 847 bytes parent folder | download | duplicates (6)
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
#!/usr/bin/perl -w
use strict;
use warnings;
use lib 'lib';  # just needed because interface lies here

# I have to generate the interface using wsdl2perl.pl before
use MyInterfaces::HelloWorld::HelloWorldSoap;

# I instantiate a interface class.
my $soap = MyInterfaces::HelloWorld::HelloWorldSoap->new({
#	proxy => 'http://localhost:8080/JLearn/WS/sayHello'
});

# I have to lookup the method and synopsis from the interface's pod
my $result = $soap->sayHello({
    name => $ARGV[1] || '"Your name"',
    givenName => $ARGV[0] || '"Your given name"',
});

# SOAP::WSDL::SOAP::Typelib::Fault11 objects are false, but serialize to XML
die $result if not $result;

# I have to lookup the output parameter from the interface's POD - or try:
# Will die on bad method names with a list of available methods
print $result->get_sayHelloResult(), "\n";