RE: [soaplite] Returning a boolean value from Perl method!
- That should work if you've got SOAP::Lite on both sides.
Note that if you are trying to interop with Apache SOAP, you may have to
write a custom deserializer on the Apache SOAP side (or possibly hack the
source, as we did). For some reason Apache SOAP interprets both "1" and "0"
as false; it requires a "true" or "false" string in the SOAP message to
interpret it correctly. SOAP::Lite refuses to encode the strings by default,
it puts the integers instead.
You could also do this with a perl SOAP::Lite serializer but I'm not sure if
it would interop with other implementations. SOAP::Lite seems to interpret
1/0 "true"/"false" interchangeably however, if I remember correctly.
From: Duncan Cameron [mailto:dcameron@...]
Sent: Thursday, April 25, 2002 6:01 PM
To: colinfaulkingham; firstname.lastname@example.org
Subject: Re: [soaplite] Returning a boolean value from Perl method!
On 2002-04-26 colinfaulkingham wrote:
>I must be missing something obvious.
>How do I return a boolen value from a method?
> return true; # or return 1;
> return false; # or return 0;
>I tried both true and false 0 and 1 and the response envelop always
>has the type of int or string.
>So, how do I say that return value 1; is a boolean value?
Something like this should work (untested!):
return SOAP::Data->type(boolean => $value ? 1 : 0);
To unsubscribe from this group, send an email to:
Your use of Yahoo! Groups is subject to http://docs.yahoo.com/info/terms/