in reply to Suppressing nil attribute in empty SOAP tag

I stumbled over the same problem a few days ago and found a possible solution.

Here is a snippet from my post to the SOAP::Lite Mailinglist.

--snip--
All I found so far on the web is the hint to create my own serializer to solve this.

I dont think this will solve my problem as I dont want to change the behaviour of SOAP::Lite with regard to serialization of an undefined parameter
but rather want to skip the parameter serialization for parameterless method calls completely.

After some UTSL I changed line 1593 in SOAP::Lite from

$body->set_value($parameters ? \$parameters : SOAP::Utils::encode_data()) if $body;

to

$body->set_value($parameters, \$parameters) if $body && $parameters;

which results in the "correct" body tag as described above.

I would like to know if there is a better way to achieve this or if not,whether we could make this behaviour configuration dependend lets say over a
method call like $handle->suppress_nils_in_parameterless_calls(1|0) as already implemented for calls like $handle->use_default_ns()
--/snip--

cat /dev/world | perl -e "(/(^.*? \?) 42\!/) && (print $1))"
errors->(c)
  • Comment on Re: Suppressing nil attribute in empty SOAP tag