Subject: | SOAP::WSDL::Expat::MessageParser fails to parse SOAP message with empty <soapenv:Header/> |
When calling a SOAP::WSDL service with an empty <soapenv:Header/> the
XML fails to parse.
eg.
<soapenv:Envelope
xmlns:soapenv="http://schemas.xmlsoap.org/soap/envelope/"
xmlns:foo="http://example.com/foo/">
<soapenv:Header/>
<soapenv:Body>
<foo:DoStuffRequest>
<foo:id>123</foo:id>
</foo:DoStuffRequest>
</soapenv:Body>
</soapenv:Envelope>
will fail to parse while:
<soapenv:Envelope
xmlns:soapenv="http://schemas.xmlsoap.org/soap/envelope/"
xmlns:foo="http://example.com/foo/">
<soapenv:Body>
<foo:DoStuffRequest>
<foo:id>123</foo:id>
</foo:DoStuffRequest>
</soapenv:Body>
</soapenv:Envelope>
will work.
This seems to happen in MessageParser where in the End handler even if
$current is undefined it is assigned to $self->{data}
if (not defined $list->[-1]) {
print STDERR "Single element current: $current\n";
$self->{ data } = $current if (not exists $self->{ data });
return;
};
Some SOAP clients send an empty SOAP header element, and thus cannot
connect to a SOAP::WSDL server as a result.