Bug in wsdl4r

  • Thread starter Marcin Raczkowski
  • Start date
M

Marcin Raczkowski

Mayby any of you happend to find solution - i generated classes with wsdl4r
and got this exception, i'm investigating but it's porbably to deep for me and
solution might be simple (wrong wsdl perhaps)

========================
/usr/lib/ruby/1.8/soap/mapping/wsdlliteralregistry.rb:321:in
`add_elements2stubobj': undefined method `name' for nil:NilClass
(NoMethodError)
from /usr/lib/ruby/1.8/soap/baseData.rb:605:in `each'
from /usr/lib/ruby/1.8/soap/mapping/wsdlliteralregistry.rb:292:in
`add_elements2stubobj'
from /usr/lib/ruby/1.8/soap/mapping/wsdlliteralregistry.rb:277:in
`soapele2stubobj'
from /usr/lib/ruby/1.8/soap/mapping/wsdlliteralregistry.rb:264:in
`any2obj'
from /usr/lib/ruby/1.8/soap/mapping/wsdlliteralregistry.rb:305:in
`add_elements2stubobj'
from /usr/lib/ruby/1.8/soap/baseData.rb:605:in `each'
from /usr/lib/ruby/1.8/soap/mapping/wsdlliteralregistry.rb:292:in
`add_elements2stubobj'
from /usr/lib/ruby/1.8/soap/mapping/wsdlliteralregistry.rb:277:in
`soapele2stubobj'
... 13 levels...
from /usr/lib/ruby/1.8/soap/rpc/proxy.rb:149:in `call'
from /usr/lib/ruby/1.8/soap/rpc/driver.rb:178:in `call'
from (eval):6:in `product_Get'
from /home/swistak/sklep/trunk/soap/DetaExchangeClient.rb:17

===================
 
M

Marcin Raczkowski

Little follow up
from what i've found it's almost certenly bug:

===============================
item = elements.find { |k, v| k.name == name }
if item
elename, class_name = item
if klass = Mapping.class_from_name(class_name)
# klass must be a SOAPBasetype or a class
if klass.ancestors.include?:):SOAP::SOAPBasetype)
if value.respond_to?:)data)
child = klass.new(value.data).data
else
child = klass.new(nil).data
end
else
child = any2obj(value, klass)
end
elsif klass = Mapping.module_from_name(class_name)
# simpletype
if value.respond_to?:)data)
child = value.data
else
raise MappingError.new(
"cannot map to a module value: #{class_name}")
end
else
raise MappingError.new("unknown class/module: #{class_name}")
end
else # untyped element is treated as anyType.
child = any2obj(value)
end
if as_array.include?(elename.name)
(vars[name] ||= []) << child
else
vars[name] = child
end
========================
elname is never even assigned if item is nil itself
 
T

Todd Benson

Little follow up
from what i've found it's almost certenly bug:

===============================
item = elements.find { |k, v| k.name == name }
if item
elename, class_name = item
snip

========================
elname is never even assigned if item is nil itself

Correct.

If item is nil, the statement immediately below it (elename,
class_name = item) will not be executed.

Todd
 
M

Marcin Raczkowski

Yea, well quick fix is changing

=A0 if as_array.include?(elename.name)
to
=A0 if item && elename && as_array.include?(elename.name)


=2D-=20
Marcin Raczkowski
=2D--
=46riends teach what you should know
Enemies Teach what you have to know
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Members online

No members online now.

Forum statistics

Threads
473,968
Messages
2,570,150
Members
46,697
Latest member
AugustNabo

Latest Threads

Top