Boolean values ("true", "false") are not serialized
correctly; they are always serialized as "true".
Line 256 of SOAP/Lite.pm (version 0.65 beta 3) is
return [$name, {'xsi:type' => 'xsd:boolean', %$attr},
$value ? 'true' : 'false'];
I think it should be
return [$name, {'xsi:type' => 'xsd:boolean', %$attr}, lc
($value) eq 'true' ? 'true' : 'false'];
Logged In: YES
user_id=884175
Originator: NO
That's a bit more difficult - actually, 'true' and 1 are true values, while 'false' and 0 are not.
I ran across almost the same in SOAP::WSDL, recently...
... going to take SOAP::WSDL's code, as I know it works...
return [ $name, { 'xsi:type' => 'xsd:boolean', %$attr}, ( $value eq 'true' or $value eq "1") ? 'true' : 'false' ];
"TRUE" is actually false, even if just by misspelling.
There's also an issue in the 1999 Serializer, which serializes bool values as (0|1). The spec actually says that (true|false) are allowed values...
... fixed in 1.45 in CVS.
Logged In: YES
user_id=1280913
Originator: YES
Thanks for the fix! I agree 1 is 'true' and 0 is 'false'. However, values of 1 and 0 will be serialized as 'int' rather than 'boolean' before this line of code can be executed. In my application, I had to convert 0 to 'false' and 1 to 'true' in my data structure before serialization occurred in order to get it typed correctly.