Skip Menu |

This queue is for tickets about the SOAP-Lite CPAN distribution.

Report information
The Basics
Id: 16897
Status: resolved
Priority: 0/
Queue: SOAP-Lite

People
Owner: Nobody in particular
Requestors: SHEVEK [...] cpan.org
Cc:
AdminCc:

Bug Information
Severity: Critical
Broken in: 0.66
Fixed in: (no value)



Subject: SOAP::Lite 0.66 fails with UNIVERSAL::use
SOAP::Lite.pm line about 2791 has a "something->body->use || ..." This clashes with UNIVERSAL::use and throws an error. This occurs when using SOAP::Lite 0.66 within Catalyst. The body() method is returning a SOAP::Custom::XML::Data object, which doesn't have a use() method (is it using autoload?) I know this is a pain in the arse and anyone using UNIVERSAL::use should be shot, but ... the problem remains. Thanks, S.
From: djo [...] cpan.org
The attached patch fixes the problem.
--- lib/SOAP/Lite.pm.orig 2006-04-05 14:45:42.675467691 +0200 +++ lib/SOAP/Lite.pm 2006-04-05 15:34:49.701431992 +0200 @@ -2804,7 +2804,7 @@ $services{$opername} = {}; # should be initialized in 5.7 and after my $soapaction = $_->operation->soapAction; my $invocationStyle = $_->operation->style || $default_style || "rpc"; - my $encodingStyle = $_->input->body->use || "encoded"; + my $encodingStyle = ( ref($_->input->body) ) ? ref($_->input->body)->use : "encoded"; my $namespace = $_->input->body->namespace || $tns; my @parts; foreach ($s->portType) {
From: tonnerre [...] thebsh.sygroup.ch
On Thu Jun 08 07:31:10 2006, DJO wrote: Show quoted text
> The attached patch fixes the problem.
Actually, the bug persists even with the patch. When I use SOAP::Lite in a Catalyst module (which uses UNIVERSAL::require and UNIVERSAL::use), I get the stack trace from the attached file. This can be easily reproduced using the following steps: * Create a new Catalyst application * Make e.g. the default controller use SOAP::Lite in some way (e.g. my $s = SOAP::Lite->service(...)) * Include a DBIx::Class schema which is using use base qw/Catalyst::Model::DBIC::Schema/; (according to the documentation The result is the above stacktrace (slightly reduced because SOAP::Lite is used elsewhere then, but well)

Message body is not shown because it is too large.

The object accessed in the line mentioned looks like beeing a SOAP::Custom::XML::Data object. These use autoloading, but assign a few methods at start. Adding "use" to the list should help: # around line 2854 in CVS: package SOAP::Custom::XML::Data; use vars qw(@ISA $AUTOLOAD); @ISA = qw(SOAP::Data); use overload fallback => 1, '""' => sub { shift->value }; # around 10 deleted lines... # add use to list of "preloaded" methods... sub BEGIN { foreach (qw(name type import use)) { _compileit($_) } } sub AUTOLOAD { my $method = substr($AUTOLOAD, rindex($AUTOLOAD, '::') + 2); return if $method eq 'DESTROY'; _compileit($method); goto &$AUTOLOAD; }
Applied the suggested resolution in CVS. Please re-open if it doesn't help. Thanks for reporting, Martin