I can't figure out what I'm doing wrong that causes the error when I execute a client script. The error again is Can't call method "run" on undefined value ...#!/usr/bin/perl -w #server code use strict; use SOAP::Transport::HTTP; use TEST; my $server = SOAP::Transport::HTTP::CGI -> on_action(sub {return}) -> dispatch_to('TEST::Tool'); $server->serializer->maptype->{SOAPStruct} = 'xsd1'; $server->handle; #server code finish #module code start package TEST; use strict; use Crazy; sub Tool{ my $class = shift; my ($men,$women) = @_; my $obj = Crazy->new(); my $hashRef = $obj->Strange($men, $women); my %hash = %$hashRef; return \%hash; } 1; package Crazy; use strict; sub new{ my $this = shift; my $class = ref($this) || $this; my $self = {}; bless ($self, $class); return $self; } sub Strange{ my $self = shift; my ($men_var,$women_var) = @_; my $factory = Acme->new(); my $app = $factory->program($men_var) || die ("$!\n"); my %hash = $app->run($women_var); return \%hash; } 1;
In reply to Can't call method "run" on undefined value... by oopnewb
| For: | Use: | ||
| & | & | ||
| < | < | ||
| > | > | ||
| [ | [ | ||
| ] | ] |