Hello most esteemed members of Perlish enlightment,
I am quite frustrated with this error as my code as run by a test script works, but when called by a SOAP::Lite client, it does not.
Code follows:
#!/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;
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 ...
TIA
oopnewb

In reply to Can't call method "run" on undefined value... by oopnewb

Title:
Use:  <p> text here (a paragraph) </p>
and:  <code> code here </code>
to format your post, it's "PerlMonks-approved HTML":



  • Posts are HTML formatted. Put <p> </p> tags around your paragraphs. Put <code> </code> tags around your code and data!
  • Titles consisting of a single word are discouraged, and in most cases are disallowed outright.
  • Read Where should I post X? if you're not absolutely sure you're posting in the right place.
  • Please read these before you post! —
  • Posts may use any of the Perl Monks Approved HTML tags:
    a, abbr, b, big, blockquote, br, caption, center, col, colgroup, dd, del, details, div, dl, dt, em, font, h1, h2, h3, h4, h5, h6, hr, i, ins, li, ol, p, pre, readmore, small, span, spoiler, strike, strong, sub, summary, sup, table, tbody, td, tfoot, th, thead, tr, tt, u, ul, wbr
  • You may need to use entities for some characters, as follows. (Exception: Within code tags, you can put the characters literally.)
            For:     Use:
    & &amp;
    < &lt;
    > &gt;
    [ &#91;
    ] &#93;
  • Link using PerlMonks shortcuts! What shortcuts can I use for linking?
  • See Writeup Formatting Tips and other pages linked from there for more info.