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

Ticket #205 (closed enhancement: fixed)

Opened 2 years ago

Last modified 1 year ago

sequence of choice not supported (was Unable to parse wsdl)

Reported by: Simon Detheridge <simon@widgit.com> Assigned to: nahi
Priority: highest Milestone: 1.5.6
Component: wsdl4r Version: 1.5
Keywords: Cc:

Description

soap4r is unable to parse my (valid) wsdl. The wsdl validates with soapscope, and WS-I, and works with .NET and gSoap. The wsdl imports a fairly complex schema, which may be the source of the errors.

When running the following program:

require 'soap/wsdlDriver'

factory = SOAP::WSDLDriverFactory.new('http://www.symgate.com/cml/symgate.wsdl')
soap = factory.create_rpc_driver

several errors are generated. When running against the version included with Ruby 1.8.4, the following output is produced:

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
/usr/lib64/ruby/1.8/wsdl/port.rb:36:in `find_binding': {}symbolisationBinding not found (RuntimeError)
        from /usr/lib64/ruby/1.8/soap/wsdlDriver.rb:88:in `init_driver'
        from /usr/lib64/ruby/1.8/soap/wsdlDriver.rb:39:in `create_rpc_driver'
        from ./mksoap.rb:6

When running against the latest soap4r 1.5.5, the following output is produced:

/usr/lib64/ruby/1.8/wsdl/xmlSchema/importer.rb:31:in `import': undefined method `location=' for nil:NilClass (NoMethodError)
        from /usr/lib64/ruby/1.8/wsdl/importer.rb:18:in `import'
        from /usr/lib64/ruby/1.8/soap/wsdlDriver.rb:124:in `import'
        from /usr/lib64/ruby/1.8/soap/wsdlDriver.rb:28:in `initialize'
        from ./mksoap.rb:5

I will attach the problem wsdl and xsd files to this bug.

Attachments

symgate.wsdl (10.7 kB) - added by Simon Detheridge <simon@widgit.com> on 05/03/06 00:01:44.
problem wsdl file
cml.xsd (8.1 kB) - added by Simon Detheridge <simon@widgit.com> on 05/03/06 00:02:14.
schema file for wsdl

Change History

05/03/06 00:01:44 changed by Simon Detheridge <simon@widgit.com>

  • attachment symgate.wsdl added.

problem wsdl file

05/03/06 00:02:14 changed by Simon Detheridge <simon@widgit.com>

  • attachment cml.xsd added.

schema file for wsdl

05/28/06 19:12:45 changed by kkkkoaaa

Keep a good job up! http://quick-adult-links.com

08/09/06 21:46:23 changed by nahi

  • priority changed from normal to high.
  • milestone changed from undefined to 1.5.6.

09/03/06 21:13:12 changed by nahi

  • summary changed from Unable to parse wsdl to sequence of choice not supported (was Unable to parse wsdl).

10/24/06 14:43:53 changed by nahi

from #284 wsdl2rb created incomplete SOAP mappings with the following wsdl file: http://www.panix.com/~vasee/download/ManufacturingService.xsd

When running the generated stub server it complains about several mappings that it cannot find.

cannot find mapped class: firstMiddleLast
cannot find mapped class: errorInfo
..

These mappings appear to be generated but not registered properly. I will try debug it further

This error occours on soapr4r release of October 10, 2006

10/24/06 14:48:04 changed by nahi

  • priority changed from high to highest.

05/14/07 21:55:19 changed by nahi

from #272

Ok, did that. Still get the following error:

/usr/local/lib/ruby/site_ruby/1.8/soap/mapping/literalregistry.rb:208:in
`add_elesoap2stubobj': undefined method `name' for #<Array:0x4027585c>
(NoMethodError)
        from /usr/local/lib/ruby/1.8/soap/baseData.rb:727:in `find'
        from
/usr/local/lib/ruby/site_ruby/1.8/soap/mapping/literalregistry.rb:208:in
`add_elesoap2stubobj'
        from /usr/local/lib/ruby/1.8/soap/baseData.rb:643:in `each'
        from
/usr/local/lib/ruby/site_ruby/1.8/soap/mapping/literalregistry.rb:207:in
`add_elesoap2stubobj'
        from
/usr/local/lib/ruby/site_ruby/1.8/soap/mapping/literalregistry.rb:184:in
`elesoap2stubobj'
        from
/usr/local/lib/ruby/site_ruby/1.8/soap/mapping/literalregistry.rb:171:in
`any2obj'
        from
/usr/local/lib/ruby/site_ruby/1.8/soap/mapping/literalregistry.rb:236:in
`elesoapchild2obj'
        from
/usr/local/lib/ruby/site_ruby/1.8/soap/mapping/literalregistry.rb:210:in
`add_elesoap2stubobj'
         ... 17 levels...
        from /usr/local/lib/ruby/1.8/soap/rpc/proxy.rb:155:in `call'
        from /usr/local/lib/ruby/1.8/soap/rpc/driver.rb:179:in `call'
        from (eval):6:in `getxxx'

I could track it down to figure out that the created
defaultMappingRegistry contains a :choice definition in one of the
schema_element definitions. This causes the code breakage in
add_elesoap2stubobj. I could fix this by editing the
defaultMappingRegistry by removing the :choice definition.

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

from #327

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.

05/20/07 15:36:16 changed by nahi

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

(In [1788]) * support combination of choice + sequence. closes #205.

06/01/07 17:29:05 changed by nahi

  • type changed from defect to enhancement.

06/01/07 18:01:51 changed by nahi

  • component changed from soap4r to wsdl4r.