Ask a Question related to PERL Modules, Design and Development.
- Stephen L. Mathias #1
Help debugging SOAP::Lite Hello,
I'm learning (or trying) to use SOAP::Lite and am having trouble
figuring out what is going on. I've been reading the O'Reilly
"Programming Web Services with Perl" book and have been using that as a
basis for my examples, but things are not working as described.
Server code:
------------
#! /usr/local/bin/perl
use strict ;
use warnings ;
use SOAP::Transport::HTTP ;
use TempConverter ;
my $port = pop(@ARGV) || 9000 ;
my $host = shift(@ARGV) || 'localhost' ;
SOAP::Transport::HTTP::Daemon->new(LocalAddr => $host,
LocalPort => $port,
Reuse => 1)
->dispatch_with( {'urn:/TempConverter' => 'TempConverter'} )
->objects_by_reference('TempConverter')
->handle;
exit;
Client code:
------------
#!/usr/local/bin/perl
use strict ;
use warnings ;
use SOAP::Lite ;
#use SOAP::Lite +trace => [qw(all)];
my $input = shift || "" ;
$input =~ /^([\d\.-]+)([CF])$/ or die "USAGE: $0 num[C|F]\n" ;
my $temp = $1 ;
my $unit = "Celsius" if $2 eq "C" ;
$unit = "Fahrenheit" if $2 eq "F" ;
my $method = 'asC' if $unit eq "Fahrenheit" ;
$method = 'asF' if $unit eq "Celsius" ;
my ($server, $endpoint, $soapaction, $soap, $response, $tempConverter) ;
$server = 'localhost' ;
$endpoint = "http://$server:9000" ;
$soapaction = "urn:TempConverter" ;
$soap = SOAP::Lite->new(uri => $soapaction,
proxy => $endpoint) ;
$response = $soap->call(new => {temp => $temp,
degrees => $unit}) ;
if ($response->fault) {
printf "A fault (%s) occurred: %s\n", $response->faultcode,
$response->faultstring ;
die ;
}
$tempConverter = $response->result ;
$response = $soap->$method($tempConverter) ;
if ($response->fault) {
printf "A fault (%s) occurred: %s\n", $response->faultcode,
$response->faultstring ;
die ;
}
print $response->result, "\n" ;
The server seems to run fine and is listening on port 9000. When I run
the client, I get:
A fault (SOAP-ENV:Client) occurred: Denied access to method (new) in class (TempConverter) at /usr/local/lib/perl5/site_perl/5.6.1/SOAP/Lite.pm line 2128.
Any help/tips/pointers on how I might figure out how to sort this out
would be much appreciated.
Steve
--
( Stephen L. Mathias, Ph.D. ( (
) Office of Biocomputing ) s m a t h i a s )
( University of New Mexico School of Medicine ( @ p o b l a n o (
) MSC08 4560 ) . h e a l t h . )
( 1 University of New Mexico ( u n m . e d u (
) Albuquerque, NM 87131-0001 ) )
Stephen L. Mathias Guest
-
SOAP::Lite
Christian Wittmer wrote: > Hi, > > new to SOAP and have some problems to get what I need. > First some info. > I have a webservice where I can... -
Writing a HTML/ASP SOAP client for a SOAP::Lite destination
How would I go about writing a SOAP client in either HTML or classic asp? The SOAP "listener" was written in Perl with SOAP::Lite in Unix and I am... -
SOAP::Lite : Problem of # sign added by SOAP::Lite in the sent SOAPActionstring
Hello, I have a problem with a SOAP client written in Perl (source at the end). I've tried both ways (by commenting TRIAL ONE or SECOND TRIAL),... -
SOAP::Lite : BUG somewhere
I tried running the demo scripts given in the SOAP::Lite tutorial that appeared in http://www.perl.com/pub/a/2001/01/soap.html. According to this... -
soap::lite and dbd::csv
sorry !! my english is very poor. i got some trouble ! please help ! if $vars is constant in Bridge.pm then the process is right! ps:DBD::CVS ...




