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 ) )