Welcome to the "trac"-ing site of soap4r!
[soap4r] [httpclient] [openpgp4u] [pkcs1] [logger] [csv] [vtr]

Ticket #327 (closed defect: fixed)

Opened 1 year ago

Last modified 1 year ago

wsdl2ruby: fatal - undefined method `namespace' for WSDL::XMLSchema::Choice:Class

Reported by: nahi Assigned to: nahi
Priority: high Milestone: 1.5.6
Component: wsdl4r Version: 1.5
Keywords: Cc:

Description

from soap4r-ml

I'm trying to parse the following WSDL:
http://zx81.highlyillogical.org/~simon/wsdl/symgate.wsdl

It has a lot if imported complex types, which is probably what is
causing the problem. Ruby's native wsdl parser
(SSOAP::WSDLDriverFactory(...).create_rpc_driver) doesn't seem to like
it either.

The wsdl works fine on everything else I've tested it with (php,
csharp, vb.net). It validates on all the static tests I can find, too.

It fails with both the gem, and current version from svn. With the
gem, it fails thusly:

I, [2007-03-08T18:15:24.109000 #2312]  INFO -- app: Creating class
definition.
I, [2007-03-08T18:15:24.125000 #2312]  INFO -- app: Creates file
'SymgateEngine.rb'.
I, [2007-03-08T18:15:24.234000 #2312]  INFO -- app: Creating mapping
registry definition.
I, [2007-03-08T18:15:24.234000 #2312]  INFO -- app: Creates file
'SymgateEngineMappingRegistry.rb'.
c:/ruby/lib/ruby/gems/1.8/gems/soap4r-1.5.5.20061022/lib/wsdl/soap/
mappingRegistryCreatorSupport.rb:113: warning: Object#type is
deprecated; use Object#class
F, [2007-03-08T18:15:24.265000 #2312] FATAL -- app: Detected an
exception. Stopping ... undefined method `namespace' for
WSDL::XMLSchema::Choice:Class (NoMethodError)
c:/ruby/lib/ruby/gems/1.8/gems/soap4r-1.5.5.20061022/lib/xsd/qname.rb:
44:in `=='
c:/ruby/lib/ruby/gems/1.8/gems/soap4r-1.5.5.20061022/lib/xsd/
namedelements.rb:44:in `[]'
c:/ruby/lib/ruby/gems/1.8/gems/soap4r-1.5.5.20061022/lib/wsdl/soap/
mappingRegistryCreatorSupport.rb:113:in `find'
c:/ruby/lib/ruby/gems/1.8/gems/soap4r-1.5.5.20061022/lib/xsd/
namedelements.rb:44:in `each'
c:/ruby/lib/ruby/gems/1.8/gems/soap4r-1.5.5.20061022/lib/xsd/
namedelements.rb:44:in `find'
c:/ruby/lib/ruby/gems/1.8/gems/soap4r-1.5.5.20061022/lib/xsd/
namedelements.rb:44:in `[]'
c:/ruby/lib/ruby/gems/1.8/gems/soap4r-1.5.5.20061022/lib/wsdl/soap/
mappingRegistryCreatorSupport.rb:134:in `basetype_class'
c:/ruby/lib/ruby/gems/1.8/gems/soap4r-1.5.5.20061022/lib/wsdl/soap/
mappingRegistryCreatorSupport.rb:113:in `element_basetype'
c:/ruby/lib/ruby/gems/1.8/gems/soap4r-1.5.5.20061022/lib/wsdl/soap/
literalMappingRegistryCreator.rb:153:in `dump_array_typemap'
c:/ruby/lib/ruby/gems/1.8/gems/soap4r-1.5.5.20061022/lib/wsdl/soap/
literalMappingRegistryCreator.rb:100:in `dump_complextypedef'
c:/ruby/lib/ruby/gems/1.8/gems/soap4r-1.5.5.20061022/lib/wsdl/soap/
literalMappingRegistryCreator.rb:91:in `dump_complextype'
c:/ruby/lib/ruby/site_ruby/1.8/rubygems/custom_require.rb:27:in
`collect'
c:/ruby/lib/ruby/gems/1.8/gems/soap4r-1.5.5.20061022/lib/xsd/
namedelements.rb:58:in `each'
c:/ruby/lib/ruby/gems/1.8/gems/soap4r-1.5.5.20061022/lib/xsd/
namedelements.rb:57:in `each'
c:/ruby/lib/ruby/gems/1.8/gems/soap4r-1.5.5.20061022/lib/wsdl/soap/
literalMappingRegistryCreator.rb:90:in `collect'
c:/ruby/lib/ruby/gems/1.8/gems/soap4r-1.5.5.20061022/lib/wsdl/soap/
literalMappingRegistryCreator.rb:90:in `dump_complextype'
c:/ruby/lib/ruby/gems/1.8/gems/soap4r-1.5.5.20061022/lib/wsdl/soap/
literalMappingRegistryCreator.rb:47:in `dump'
c:/ruby/lib/ruby/gems/1.8/gems/soap4r-1.5.5.20061022/lib/wsdl/soap/
mappingRegistryCreator.rb:46:in `dump'
c:/ruby/lib/ruby/gems/1.8/gems/soap4r-1.5.5.20061022/lib/wsdl/soap/
wsdl2ruby.rb:83:in `create_mapping_registry'
c:/ruby/lib/ruby/gems/1.8/gems/soap4r-1.5.5.20061022/lib/wsdl/soap/
wsdl2ruby.rb:155:in `write_file'
c:/ruby/lib/ruby/gems/1.8/gems/soap4r-1.5.5.20061022/lib/wsdl/soap/
wsdl2ruby.rb:154:in `open'
c:/ruby/lib/ruby/gems/1.8/gems/soap4r-1.5.5.20061022/lib/wsdl/soap/
wsdl2ruby.rb:154:in `write_file'
c:/ruby/lib/ruby/gems/1.8/gems/soap4r-1.5.5.20061022/lib/wsdl/soap/
wsdl2ruby.rb:81:in `create_mapping_registry'
c:/ruby/lib/ruby/gems/1.8/gems/soap4r-1.5.5.20061022/lib/wsdl/soap/
wsdl2ruby.rb:60:in `create_file'
c:/ruby/lib/ruby/gems/1.8/gems/soap4r-1.5.5.20061022/lib/wsdl/soap/
wsdl2ruby.rb:40:in `run'
c:/ruby/lib/ruby/gems/1.8/gems/soap4r-1.5.5.20061022/bin/wsdl2ruby.rb:
44:in `run'
c:/ruby/lib/ruby/1.8/logger.rb:659:in `start'
c:/ruby/lib/ruby/gems/1.8/gems/soap4r-1.5.5.20061022/bin/wsdl2ruby.rb:
131
c:/ruby/bin/wsdl2ruby.rb:18:in `load'
c:/ruby/bin/wsdl2ruby.rb:18
I, [2007-03-08T18:15:24.328000 #2312]  INFO -- app: End of app.
(status: -1)

Here's what happens with the svn version:

ignored element: {http://www.w3.org/2001/XMLSchema}choice of
WSDL::XMLSchema::Sequence
ignored element: {http://www.w3.org/2001/XMLSchema}sequence of
WSDL::XMLSchema::Sequence
ignored element: {http://www.w3.org/2001/XMLSchema}choice
I, [2007-03-08T18:27:17.203000 #2724]  INFO -- app: Creating class
definition.
I, [2007-03-08T18:27:17.218000 #2724]  INFO -- app: Creates file
'SymgateEngine.rb'.
F, [2007-03-08T18:27:17.296000 #2724] FATAL -- app: Detected an
exception. Stopping ... undefined method `check_type' for nil:NilClass
(NoMethodError)
c:/ruby/lib/ruby/1.8/wsdl/soap/complexType.rb:38:in `check_type'
c:/ruby/lib/ruby/1.8/wsdl/soap/complexType.rb:19:in `compoundtype'
c:/ruby/lib/ruby/1.8/wsdl/soap/classDefCreator.rb:78:in
`dump_complextype'
c:/ruby/lib/ruby/1.8/wsdl/xmlSchema/importer.rb:78:in `collect'
c:/ruby/lib/ruby/1.8/xsd/namedelements.rb:58:in `each'
c:/ruby/lib/ruby/1.8/xsd/namedelements.rb:57:in `each'
c:/ruby/lib/ruby/1.8/wsdl/soap/classDefCreator.rb:77:in `collect'
c:/ruby/lib/ruby/1.8/wsdl/soap/classDefCreator.rb:77:in
`dump_complextype'
c:/ruby/lib/ruby/1.8/wsdl/soap/classDefCreator.rb:41:in `dump'
c:/ruby/lib/ruby/1.8/wsdl/soap/wsdl2ruby.rb:64:in `create_classdef'
c:/ruby/lib/ruby/1.8/wsdl/soap/wsdl2ruby.rb:135:in `write_file'
c:/ruby/lib/ruby/1.8/wsdl/soap/wsdl2ruby.rb:134:in `open'
c:/ruby/lib/ruby/1.8/wsdl/soap/wsdl2ruby.rb:134:in `write_file'
c:/ruby/lib/ruby/1.8/wsdl/soap/wsdl2ruby.rb:63:in `create_classdef'
c:/ruby/lib/ruby/1.8/wsdl/soap/wsdl2ruby.rb:51:in `create_file'
c:/ruby/lib/ruby/1.8/wsdl/soap/wsdl2ruby.rb:36:in `run'
C:/code/soap4r/bin/wsdl2ruby.rb:44:in `run'
c:/ruby/lib/ruby/1.8/logger.rb:659:in `start'
C:/code/soap4r/bin/wsdl2ruby.rb:131
I, [2007-03-08T18:27:17.359000 #2724]  INFO -- app: End of app.
(status: -1)

Help appreciated. I'm no ruby expert so haven't tried looking at the
code where the errors are coming from.

Thanks,
Simon

Change History

05/05/07 00:40:03 changed by nahi

  • priority changed from normal to high.

05/14/07 21:56:23 changed by nahi

  • status changed from new to closed.
  • resolution set to duplicate.

-> #205

06/03/07 09:05:17 changed by nahi

  • status changed from closed to reopened.
  • resolution deleted.

06/03/07 09:06:08 changed by nahi

from RubyForge? Ruby tracker:

Date: 2007-06-01 06:19
Sender: Simon Detheridge

It gets further, but still doesn't work properly. It fails
if I try to create_rpc_driver, like so:

irb(main):001:0> require 'soap/wsdlDriver'
=> true
irb(main):002:0> sf =
SOAP::WSDLDriverFactory.new('symgate.wsdl')
ignored element: {http://www.w3.org/2001/XMLSchema}choice of
WSDL::XMLSchema::Sequence
ignored element: {http://www.w3.org/2001/XMLSchema}sequence
of WSDL::XMLSchema::Sequence
ignored element: {http://www.w3.org/2001/XMLSchema}choice
=>
#<SOAP::WSDLDriverFactory:{http://www.symgate.com/symgate}Symg
ateEngine>
irb(main):003:0> s = sf.create_rpc_driver
RuntimeError: {}symbolisationBinding not found
        from c:/ruby/lib/ruby/1.8/wsdl/port.rb:36:in
`find_binding'
        from c:/ruby/lib/ruby/1.8/soap/wsdlDriver.rb:88:in
`init_driver'
        from c:/ruby/lib/ruby/1.8/soap/wsdlDriver.rb:39:in
`create_rpc_driver'
        from (irb):3
        from ♥:0

Similarly, wsdl2ruby.rb fails, complaining:

C:\sge_ruby>wsdl2ruby.rb --wsdl symgate.wsdl --type client
--force
I, [2007-06-01T11:16:33.261000 #11256]  INFO -- app:
Creating class definition.
I, [2007-06-01T11:16:33.261000 #11256]  INFO -- app: Creates
file 'SymgateEngine.rb'.
F, [2007-06-01T11:16:33.277000 #11256] FATAL -- app:
Detected an exception. Stopping ... undefined method
`map_as_array?' for #<WSDL::XMLSchema::Choice:0x418c4e2>
(NoMethodError)
c:/ruby/lib/ruby/gems/1.8/gems/soap4r-1.5.5.20070528/lib/wsdl/soa
p/complexType.rb:27:in
`check_type'
c:/ruby/lib/ruby/gems/1.8/gems/soap4r-1.5.5.20070528/lib/wsdl/soa
p/complexType.rb:19:in
`compoundtype'
c:/ruby/lib/ruby/gems/1.8/gems/soap4r-1.5.5.20070528/lib/wsdl/soa
p/classDefCreator.rb:216:in
`dump_complextypedef'
c:/ruby/lib/ruby/gems/1.8/gems/soap4r-1.5.5.20070528/lib/wsdl/soa
p/classDefCreator.rb:112:in
`dump_complextype'
c:/ruby/lib/ruby/site_ruby/1.8/rubygems/custom_require.rb:27:in
`collect'
c:/ruby/lib/ruby/gems/1.8/gems/soap4r-1.5.5.20070528/lib/xsd/name
delements.rb:58:in
`each'
c:/ruby/lib/ruby/gems/1.8/gems/soap4r-1.5.5.20070528/lib/xsd/name
delements.rb:57:in
`each'
c:/ruby/lib/ruby/gems/1.8/gems/soap4r-1.5.5.20070528/lib/wsdl/soa
p/classDefCreator.rb:111:in
`collect'
c:/ruby/lib/ruby/gems/1.8/gems/soap4r-1.5.5.20070528/lib/wsdl/soa
p/classDefCreator.rb:111:in
`dump_complextype'
c:/ruby/lib/ruby/gems/1.8/gems/soap4r-1.5.5.20070528/lib/wsdl/soa
p/classDefCreator.rb:49:in
`dump'
c:/ruby/lib/ruby/gems/1.8/gems/soap4r-1.5.5.20070528/lib/wsdl/soa
p/wsdl2ruby.rb:73:in
`create_classdef'
c:/ruby/lib/ruby/gems/1.8/gems/soap4r-1.5.5.20070528/lib/wsdl/soa
p/wsdl2ruby.rb:156:in
`write_file'
c:/ruby/lib/ruby/gems/1.8/gems/soap4r-1.5.5.20070528/lib/wsdl/soa
p/wsdl2ruby.rb:155:in
`open'
c:/ruby/lib/ruby/gems/1.8/gems/soap4r-1.5.5.20070528/lib/wsdl/soa
p/wsdl2ruby.rb:155:in
`write_file'
c:/ruby/lib/ruby/gems/1.8/gems/soap4r-1.5.5.20070528/lib/wsdl/soa
p/wsdl2ruby.rb:72:in
`create_classdef'
c:/ruby/lib/ruby/gems/1.8/gems/soap4r-1.5.5.20070528/lib/wsdl/soa
p/wsdl2ruby.rb:59:in
`create_file'
c:/ruby/lib/ruby/gems/1.8/gems/soap4r-1.5.5.20070528/lib/wsdl/soa
p/wsdl2ruby.rb:40:in
`run'
c:/ruby/lib/ruby/gems/1.8/gems/soap4r-1.5.5.20070528/bin/wsdl2rub
y.rb:44:in
`run'
c:/ruby/lib/ruby/1.8/logger.rb:659:in `start'
c:/ruby/lib/ruby/gems/1.8/gems/soap4r-1.5.5.20070528/bin/wsdl2rub
y.rb:131
c:/ruby/bin/wsdl2ruby.rb:18:in `load'
c:/ruby/bin/wsdl2ruby.rb:18
I, [2007-06-01T11:16:33.277000 #11256]  INFO -- app: End of
app. (status: -1)

06/03/07 13:56:55 changed by nahi

  • status changed from reopened to closed.
  • resolution set to fixed.

(In [1827]) * handle choice + maxOccurs="unbounded" correctly. closes #327.