1#!/usr/bin/perl -w
2package main;
3use strict;
4use warnings;
5use lib '../../lib';
6use lib '../lib';
7use MyServer::HelloWorld::HelloWorldSoap;
8
9my $soap = MyServer::HelloWorld::HelloWorldSoap->new({
10    dispatch_to => 'main',
11});
12
13$soap->handle();
14
15sub sayHello {
16    my ($self, $body, $header) = @_;
17    my $name = $body->get_name();
18    my $givenName = $body->get_givenName();
19
20    return MyElements::sayHelloResponse->new({
21        sayHelloResult => "Hello $givenName $name"
22    })
23}
24
25=pod
26
27=head1 NAME
28
29helloworld.pl - a simple CGI-based SOAP server implementing the service from
30in examples/wsdl/helloworld.wsdl
31
32=head1 USAGE
33
34Before using this script, you should secure your webserver. The easiest way
35to do so is to let it listen to 127.0.0.1 only.
36
37Then make a ScriptAlias named /soap-wsdl-test/ pointing at the directory
38this file lies in.
39
40For my apache, it looks like this:
41
42 ScriptAlias /soap-wsdl-test/ /home/martin/workspace/SOAP-WSDL/example/cgi-bin/
43 <Directory "/home/martin/workspace/SOAP-WSDL/example/cgi-bin">
44    AllowOverride None
45    Options +ExecCGI -MultiViews
46    Order allow,deny
47    Allow from all
48 </Directory>
49
50Then run the helloworld.pl from the examples directory. It should print
51
52 Hello World
53
54=head1 DESCRIPTION
55
56=cut
57
58