Skip Menu |

This queue is for tickets about the Net-Google CPAN distribution.

Report information
The Basics
Id: 6167
Status: resolved
Priority: 0/
Queue: Net-Google

People
Owner: Nobody in particular
Requestors: Peter [...] PSDT.com
Cc:
AdminCc:

Bug Information
Severity: Important
Broken in: 0.61
Fixed in: (no value)



Subject: boolean type problem
I just tracked down a problem with Net::Google to the value passed in a xsd:boolean element. Specifically, when a query is sent across with <filter xsi:type="xsd:boolean">1</filter> the Google API interprets that as False, as evidenced by a parameter in its response that indicates whether filtering was enabled. If the request contains <filter xsi:type="xsd:boolean">true</filter> then it takes it as being true. Either Google is at fault or SOAP::Data i wrong for forcing truth to 1 instead of 'true'; I don't know which, so I sent this to the SOAP::Lite maintainer. Either way, the way for Net::Google to workaround and get the right behavior is to change the code SOAP::Data->type(boolean=>($self->filter() ? 1 : 0)), in the _response() method and changing the above to ($self->filter ? 'true' : 'false')
From: LudwigS
[guest - Thu Apr 29 14:05:31 2004]: Show quoted text
> I just tracked down a problem with Net::Google to the value passed in > a xsd:boolean element. Specifically, when a query is sent across with > > <filter xsi:type="xsd:boolean">1</filter> > > the Google API interprets that as False, as evidenced by a parameter > in its response that indicates whether filtering was enabled. If the > request contains > > <filter xsi:type="xsd:boolean">true</filter> > > then it takes it as being true. > > Either Google is at fault or SOAP::Data i wrong for forcing truth to 1 > instead of 'true'; I don't know which, so I sent this to the > SOAP::Lite maintainer. > > Either way, the way for Net::Google to workaround and get the right > behavior is to change the code > > SOAP::Data->type(boolean=>($self->filter() > ? 1 : 0)), > > in the _response() method and changing the above to > > ($self->filter ? 'true' : 'false')
Problem seems to be associated with SOAP:Lite. I found some details in some .pl scripts using SOAP:Lite for retrieving google results: # nb: # - The two booleans in the search above must be "false" or "true" (not 1 or # 0). Previously this script used 'SOAP::Data->type(boolean => "false")' # which came out as '0' in the SOAP message, but wasn't understood by the # Google interface. # - I understand that the Schema definition workaround above isn't needed if # you're using SOAP::Lite 0.52 or above. I've been using 0.51. # nb 19apr2002: # - Chris Nandor pointed out that the query needs escaping. I've put a very # simplistic xml_clean sub in to do that, although you should really use # the xml_escape function from XML::Parser. # Redefine how the default deserializer handles booleans. # Workaround because the 1999 schema implementation incorrectly doesn't # accept "true" and "false" for boolean values. # See http://groups.yahoo.com/group/soaplite/message/895
This has been fixed in Net::Google 0.62 which will be released shortly. Cheers, [guest - Thu Apr 29 14:05:31 2004]: Show quoted text
> I just tracked down a problem with Net::Google to the value passed in > a xsd:boolean element. Specifically, when a query is sent across with > > <filter xsi:type="xsd:boolean">1</filter> > > the Google API interprets that as False, as evidenced by a parameter > in its response that indicates whether filtering was enabled. If the > request contains > > <filter xsi:type="xsd:boolean">true</filter> > > then it takes it as being true. > > Either Google is at fault or SOAP::Data i wrong for forcing truth to 1 > instead of 'true'; I don't know which, so I sent this to the > SOAP::Lite maintainer. > > Either way, the way for Net::Google to workaround and get the right > behavior is to change the code > > SOAP::Data->type(boolean=>($self->filter() > ? 1 : 0)), > > in the _response() method and changing the above to > > ($self->filter ? 'true' : 'false')