File: fortune.pl

package info (click to toggle)
libsoap-wsdl-perl 3.003-3
  • links: PTS, VCS
  • area: main
  • in suites: buster
  • size: 2,860 kB
  • sloc: perl: 8,431; xml: 1,769; java: 19; makefile: 15
file content (47 lines) | stat: -rw-r--r-- 1,348 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
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
# Accessing the fortune cookie service at
# www.fullerdata.com/FortuneCookie/FortuneCookie.asmx
#
# I have no connection to www.fullerdata.com 
# 
# Use this script at your own risk.

# Run before:
# D:\Eigene Dateien\Martin\SOAP-WSDL\trunk>perl -I../lib wsdl2perl.pl "file:///D:/
# Eigene Dateien/Martin/SOAP-WSDL/trunk/bin/FortuneCookie.xml"

use lib 'lib/';
use MyInterfaces::FullerData_x0020_Fortune_x0020_Cookie::FullerData_x0020_Fortune_x0020_CookieSoap;
my $cookieService = MyInterfaces::FullerData_x0020_Fortune_x0020_Cookie::FullerData_x0020_Fortune_x0020_CookieSoap->new();

my $cookie;
$cookie = $cookieService->GetFortuneCookie()
  or die "$cookie";

print $cookie->get_GetFortuneCookieResult()->get_value, "\n\n";

$cookie = $cookieService->GetSpecificCookie({ index => 23 })
  or die "$cookie";

print $cookie->get_GetSpecificCookieResult(), "\n";

# print $cookie;


=for demo:

# the same in SOAP lite (second call)
#

use SOAP::Lite;

my $lite = SOAP::Lite->new()->on_action(sub { join '/', @_ } )
  ->proxy('http://www.fullerdata.com/FortuneCookie/FortuneCookie.asmx');

$lite->call(
    SOAP::Data->name('GetSpecificCookie')
      ->attr({ 'xmlns', 'http://www.fullerdata.com/FortuneCookie/FortuneCookie.asmx' }), 
      SOAP::Data->name('index')->value(23) 
  );

die $soap->message() if ($soap->fault());
print $soap->result();