SOAP::Lite SOAP::Trace::trace bug ?
Jim Cromie <[email protected]> Mon, 23 Dec 2002 14:42:26 -0800
| Newsgroups | gmane.comp.windows.devel.soap.general |
|---|---|
| Message-ID | <SOAP%[email protected]> |
while single-stepping thru SOAP::Lite dispatch process, I encountered
something that might be a bug. Its minor, but its easy to fix too.
(for some definition of fix)
trace() looks up the call stack to produce a trace output.
by default, it looks up 1 level, but
line 2243 looks an extra level if the 1st is an (eval).
below, at debugger step <99>, theres a 'T' stack-trace, which shows
2 consecutive evals.
SOAP::Trace::defaultlog(/usr/local/lib/perl5/site_perl/5.8.0/SOAP/Lite.pm:2243):
2243: $caller = (caller(2))[3] if $caller =~ /eval/;
DB<98>
SOAP::Trace::defaultlog(/usr/local/lib/perl5/site_perl/5.8.0/SOAP/Lite.pm:2244):
2244: chomp(my $msg = join ' ', @_);
DB<98> x @_
0 HASH(0x8ba1fe8)
'Location' => 'passed in example'
DB<99>
SOAP::Trace::defaultlog(/usr/local/lib/perl5/site_perl/5.8.0/SOAP/Lite.pm:2245):
2245: printf STDERR "%s: %s\n", $caller, $msg;
DB<99>
(eval): HASH(0x8ba1fe8)
SOAP::Server::handle(/usr/local/lib/perl5/site_perl/5.8.0/SOAP/Lite.pm:2176):
2176: push @parameters, $request if UNIVERSAL::isa($class =>
'SOAP::Server::Parameters');
2177: SOAP::Server::Object->references(
2178: defined $parameters[0] && ref $parameters[0] &&
UNIVERSAL::isa($parameters[0] => $class)
DB<99> T
@ = eval {...} called from file
`/usr/local/lib/perl5/site_perl/5.8.0/SOAP/Lite.pm' line 2170
$ = eval {...} called from file
`/usr/local/lib/perl5/site_perl/5.8.0/SOAP/Lite.pm' line 2142
$ = SOAP::Server::handle(ref(SOAP::Transport::HTTP::Daemon), '<?xml
version="1.0" encoding="UTF-8"?><SOAP-ENV:Envelope
xmlns:xsi="http://www.w3.org/1999/XMLSchema-instance"
xmlns:SOAP-ENC="http://schemas.xmlsoap.org/soap/encoding/"
xmlns:SOAP-ENV="http://schemas.xmlsoap.org/soap/envelope/"
xmlns:xsd="http://www.w3.org/1999/XMLSchema"
xmlns:namesp2="http://xml.apache.org/xml-soap"
SOAP-ENV:encodingStyle="http://schemas... called from file
`/usr/local/lib/perl5/site_perl/5.8.0/SOAP/Transport/HTTP.pm' line 258
. =
SOAP::Transport::HTTP::Server::handle(ref(SOAP::Transport::HTTP::Daemon))
called from file
`/usr/local/lib/perl5/site_perl/5.8.0/SOAP/Transport/HTTP.pm' line 393
. =
SOAP::Transport::HTTP::Daemon::handle(ref(SOAP::Transport::HTTP::Daemon))
called from file `tgw-prefork.pl' line 88
To catch this, probably want a loop to work past multiple 'eval'
stack-frames. Something like this (untested)
{ my $level=1;
do { $caller = (caller($level++))[3] } while ($caller =~ /eval/ and $caller)
}
You can read messages from the SOAP archive, unsubscribe from SOAP, or subscribe to other
DevelopMentor lists at http://discuss.develop.com.