Mike Burdick
10-07-2005, 01:49 PM
Hi,
I'm just starting with SOAP, so I went to the `net to see if I could
find an example to get something to work.
Okay here's what I did. I have three files and I put them on my
website server and put them in the directories stated:
File Hello.pm - Put this in directory /lib
# Hello.pm - simple Hello module
package Hello;
sub sayHello {
shift; # remove class name
return "Hello " . shift;
}
1;
File helloworld.cgi – Put this in directory /cgi-bin
#!/usr/bin/perl -w
# helloworld.cgi - Hello SOAP handler
use lib '/lib';
use SOAP::Transport::HTTP;
SOAP::Transport::HTTP::CGI
dispatch_to('Hello::(?:sayHello)')
-> handle
;
File hw_client.pl - Put this in directory /cgi-bin
#!/usr/bin/perl -w
# hw_client.pl - Hello client
use SOAP::Lite;
my $name = shift;
print "\n\nCalling the SOAP Server to say hello\n\n";
print "The SOAP Server says: ";
print SOAP::Lite
-> uri('urn:Example1')
-> proxy('http://localhost/cgi-bin/helloworld.cgi')
-> sayHello($name)
result . "\n\n";
The original example came from:
http://aspn.activestate.com/ASPN/docs/ActivePerl/5.8/site/lib/SOAP/Lite.html
When I run hw_client it doesn't do what it should. Does anyone know
what my problem is?
Any help would be appreciated!
Mike
I'm just starting with SOAP, so I went to the `net to see if I could
find an example to get something to work.
Okay here's what I did. I have three files and I put them on my
website server and put them in the directories stated:
File Hello.pm - Put this in directory /lib
# Hello.pm - simple Hello module
package Hello;
sub sayHello {
shift; # remove class name
return "Hello " . shift;
}
1;
File helloworld.cgi – Put this in directory /cgi-bin
#!/usr/bin/perl -w
# helloworld.cgi - Hello SOAP handler
use lib '/lib';
use SOAP::Transport::HTTP;
SOAP::Transport::HTTP::CGI
dispatch_to('Hello::(?:sayHello)')
-> handle
;
File hw_client.pl - Put this in directory /cgi-bin
#!/usr/bin/perl -w
# hw_client.pl - Hello client
use SOAP::Lite;
my $name = shift;
print "\n\nCalling the SOAP Server to say hello\n\n";
print "The SOAP Server says: ";
print SOAP::Lite
-> uri('urn:Example1')
-> proxy('http://localhost/cgi-bin/helloworld.cgi')
-> sayHello($name)
result . "\n\n";
The original example came from:
http://aspn.activestate.com/ASPN/docs/ActivePerl/5.8/site/lib/SOAP/Lite.html
When I run hw_client it doesn't do what it should. Does anyone know
what my problem is?
Any help would be appreciated!
Mike