Subject: | MessageParser misses character data in elements just below SOAP-ENV:Body |
This bug is triggered by the same WSDL as in bug 34688. After running
wsdl2perl.pl, I use the attached helloWorld.pl to query the
webservice. The output is "Use of uninitialized value in concatenation
(.) or string at ./helloWorld.pl line 9" instead of the expected
result.
The problem seems to be that the relevant character data is contained
in the helloWorldResponse element directly below the SOAP-ENV:Body
element, and the MessageParser misses it there. The attached patch
fixes the bug for me, but please check if it is really the correct way
to do it because my understanding of SOAP::WSDL is not that good.
Thank you.
Subject: | MessageParser.diff |
--- SOAP-WSDL-2.00_33/lib/SOAP/WSDL/Expat/MessageParser.pm
+++ SOAP-WSDL-2.00_33/lib/SOAP/WSDL/Expat/MessageParser.pm
@@ -194,13 +194,6 @@ sub _initialize {
$depth--;
- # return if there's only one elment - can't set it in parent ;-)
- # but set as root element if we don't have one already.
- if (not defined $list->[-1]) {
- $self->{ data } = $current if (not exists $self->{ data });
- return;
- };
-
# we only set character values in leaf nodes
if ($_leaf) {
# Use dirty but fast access via global variables.
@@ -216,6 +209,13 @@ sub _initialize {
# empty characters
$characters = q{};
+ # return if there's only one elment - can't set it in parent ;-)
+ # but set as root element if we don't have one already.
+ if (not defined $list->[-1]) {
+ $self->{ data } = $current if (not exists $self->{ data });
+ return;
+ };
+
# set appropriate attribute in last element
# multiple values must be implemented in base class
# $_method = "add_$_localname";
Subject: | helloWorld.pl |
#!/usr/bin/perl
$^W = 1; # like perl -w
use strict;
use MyInterfaces::TestService::TestPort;
my $interface = MyInterfaces::TestService::TestPort->new();
my $response = $interface->helloWorld({value => 'hello'}, {value => 'world'});
print $response->get_value()."\n";