B
bmm
Hi reader,
It _seems_ SOAP is eager to parse number only values into number,
however it fails if those numbers are to large. The following code
raises the problem if you have a valid Google WebAPI key:
require 'soap/wsdlDriver'
key = 'YOURVALIDKEY'
soap =
SOAP::WSDLDriverFactory.new('http://api.google.com/GoogleSearch.wsdl').create_rpc_driver
r = soap.doGoogleSearch(key, 'wacky something asdf', 0, 1, false, "",
false, "", "", "" )
puts "No problem: #{r.estimatedTotalResultsCount}"
r = soap.doGoogleSearch(key, 'google', 0, 1, false, "", false, "", "",
"" )
puts "Will never get here"
The result on Debian/Linux ruby1.8 and ruby 1.9 is:
SOAP::FaultError: Exception from service object: For input string:
"2400000000"
from #<SOAP::Mapping::Object:0xb799d29c>
The input string is normal, so what is the problem here? Is ruby trying
to interpret this string and failing?
It _seems_ SOAP is eager to parse number only values into number,
however it fails if those numbers are to large. The following code
raises the problem if you have a valid Google WebAPI key:
require 'soap/wsdlDriver'
key = 'YOURVALIDKEY'
soap =
SOAP::WSDLDriverFactory.new('http://api.google.com/GoogleSearch.wsdl').create_rpc_driver
r = soap.doGoogleSearch(key, 'wacky something asdf', 0, 1, false, "",
false, "", "", "" )
puts "No problem: #{r.estimatedTotalResultsCount}"
r = soap.doGoogleSearch(key, 'google', 0, 1, false, "", false, "", "",
"" )
puts "Will never get here"
The result on Debian/Linux ruby1.8 and ruby 1.9 is:
SOAP::FaultError: Exception from service object: For input string:
"2400000000"
from #<SOAP::Mapping::Object:0xb799d29c>
The input string is normal, so what is the problem here? Is ruby trying
to interpret this string and failing?