SOAP-Lite - Re: Can't call method name at SOAP Lite.pm line 2980.

Posted on Tue Jan 16 08:30:10 2007 by saramic in response to 4039 (See the whole thread of 5)
Re: Can't call method name at SOAP Lite.pm line 2980.
not a super user of SOAP::Lite but I will try to help
SOAP::Lite 0.60 http://search.cpan.org/src/BYRNE/SOAP-Lite-0.60a/lib/SOAP/Lite.pm
sub stub { my $self = shift->new; my $package = shift; my $services = $self->services->{$package}; my $schema = $self->schema; .... map(" SOAP::Data->new(name => '" . $_->name . "', type => '" . $_->type . "', attr => {" . do{ my %attr = %{$_->attr}; join ', ', map {"'$_' => '$ +attr{$_}'"} grep {/^xmlns:(?!-)/} keys %attr} . "}),", @{$services->{$service}{parameters}}), " ],\n },", ), ....
SOAP::Lite 0.67 http://search.cpan.org/src/BYRNE/SOAP-Lite-0.67/lib/SOAP/Lite.pm
line 2980 is $self->{'_stub'} .= " SOAP::Data->new(name => '".$_->name."', type => '".$_->type."', attr => {";
sub generate_stub { my $self = shift->new; my $package = shift; my $services = $self->services->{$package}; my $schema_url = $self->schema_url; .... foreach (@{$services->{$service}{parameters}}) { # next unless $_; $self->{'_stub'} .= " SOAP::Data->new(name => '".$_->name."', type => '".$_->type."', at +tr => {"; $self->{'_stub'} .= do { my %attr = %{$_->attr}; join(', ', map {"'$_' => '$attr{$_}'"} grep {/^xmlns:(?!-)/} keys %attr) }; $self->{'_stub'} .= "}),\n";

so both go over the array
@{$services->{$service}{parameters}}
it is just that the old version used map which would automaticaly skip over null values while the newer version (and current 0.69) do not skip over null values (but note the next unless $_; code is there it is just not used). I presume this is to make sure that all parameters are valid/exist etc. so something to do with named parameters I guess but I would need to look more closely at other output. if I remember correctly your $url is the WSDL url, can you upload a section of the WSDL to see if it is correct? is it right on that line that if fails or is it what you call the service you create with something like
$service->call('fetchBankBalance' => 'Larry Wall');

cheers Saramic
Direct Responses: 4054 | Write a response