Subject: | SOAP-Lite fails for operations with period in name |
Having the following in WSDL:
<definitions .... >
<binding .... >
<operation name=UserApi.GetUserStatus >
...
</operation>
</binding>
</definitions>
The code:
my $soap = SOAP::Lite->service("file:$wsdl_filename");
Throws:
SOAP Fail: Bareword "SiteApi" not allowed while "strict subs" in use at
(eval 1224) line 6.
Bareword "UserApi" not allowed while "strict subs" in use at (eval 1224)
line 6
...
at /usr/lib64/perl5/site_perl/5.8.8/SOAP/Lite.pm line 3685
"Bareword XXX not allowed" is repeated for every operation of WSDL with
period in name (presumably).
The attached patch for Lite.pm v0.714 seems to fix this issue
completely.
My perl is "v5.8.8 built for x86_64-linux-thread-multi"
Subject: | Lite.pm.patch |
--- Lite.pm.bak 2012-01-24 12:18:28.961931456 +0400
+++ Lite.pm 2012-01-24 12:23:19.949926312 +0400
@@ -3273,7 +3273,7 @@
$self->{'_stub'} .= "# -- generated from $schema_url\n" if $schema_url;
$self->{'_stub'} .= 'my %methods = ('."\n";
foreach my $service (keys %$services) {
- $self->{'_stub'} .= "$service => {\n";
+ $self->{'_stub'} .= "'$service' => {\n";
foreach (qw(endpoint soapaction namespace)) {
$self->{'_stub'} .= " $_ => '".$services->{$service}{$_}."',\n";
}