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

Ticket #151 (closed defect: fixed)

Opened 5 years ago

Last modified 5 years ago

soap4r-1_5_5 wsdl2ruby.rb fails (elementFormDefault

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

Description

After upgrading to 1_5_5, wsdl2ruby no longer works with the salesforce partner WSDL:

rex-mini:~/work/rforce-svn/wsdl rex$ wsdl2ruby.rb --type client --wsdl partner.wsdl.xml 
F, [2005-09-18T17:07:06.624459 #4872] FATAL -- app: Detected an exception. Stopping ... undefined method `elementFormDefault' for #<WSDL::XMLSchema::ComplexType:0x6ea4ac> (NoMethodError)
/usr/lib/ruby/site_ruby/1.8/wsdl/xmlSchema/sequence.rb:33:in `elementformdefault'
/usr/lib/ruby/site_ruby/1.8/wsdl/xmlSchema/element.rb:87:in `elementform'
/usr/lib/ruby/site_ruby/1.8/wsdl/xmlSchema/element.rb:111:in `parse_attr'
/usr/lib/ruby/site_ruby/1.8/wsdl/parser.rb:143:in `decode_tag'
/usr/lib/ruby/site_ruby/1.8/wsdl/parser.rb:139:in `each'
/usr/lib/ruby/site_ruby/1.8/wsdl/parser.rb:139:in `decode_tag'
/usr/lib/ruby/site_ruby/1.8/wsdl/parser.rb:84:in `start_element'
/usr/lib/ruby/site_ruby/1.8/xsd/xmlparser/parser.rb:67:in `start_element'
/usr/lib/ruby/site_ruby/1.8/xsd/xmlparser/xmlscanner.rb:139:in `on_stag_end'
/usr/lib/ruby/site_ruby/1.8/xsd/xmlparser/xmlscanner.rb:134:in `on_stag_end_empty'
/usr/lib/ruby/site_ruby/1.8/xmlscan/scanner.rb:470:in `on_stag_end_empty'
/usr/lib/ruby/site_ruby/1.8/xmlscan/scanner.rb:794:in `scan_stag'
/usr/lib/ruby/site_ruby/1.8/xmlscan/scanner.rb:826:in `scan_content'
/usr/lib/ruby/site_ruby/1.8/xmlscan/scanner.rb:1051:in `scan_prolog'
/usr/lib/ruby/site_ruby/1.8/xmlscan/scanner.rb:1058:in `scan_document'
/usr/lib/ruby/site_ruby/1.8/xmlscan/scanner.rb:1073:in `parse'
/usr/lib/ruby/site_ruby/1.8/xsd/xmlparser/xmlscanner.rb:25:in `do_parse'
/usr/lib/ruby/site_ruby/1.8/wsdl/parser.rb:65:in `parse'
/usr/lib/ruby/site_ruby/1.8/wsdl/importer.rb:29:in `parse'
/usr/lib/ruby/site_ruby/1.8/wsdl/xmlSchema/importer.rb:30:in `import'
/usr/lib/ruby/site_ruby/1.8/wsdl/importer.rb:18:in `import'
/usr/lib/ruby/site_ruby/1.8/wsdl/soap/wsdl2ruby.rb:170:in `import'
/usr/lib/ruby/site_ruby/1.8/wsdl/soap/wsdl2ruby.rb:34:in `run'
/usr/local/bin/wsdl2ruby.rb:42:in `run'
/usr/lib/ruby/1.8/logger.rb:684:in `start'
/usr/local/bin/wsdl2ruby.rb:125
I, [2005-09-18T17:07:06.627008 #4872]  INFO -- app: End of app. (status: -1)

Change History

09/19/05 09:48:43 changed by wrex

After playing with the ruby debugger, it appears that wsdl2ruby.rb is failing on the following stanza in the wsdl file:

            <complexType name="ApiQueryFault">
                <complexContent>
                    <extension base="fns:ApiFault">
                        <sequence>
                        <element name="row" type="xsd:int"/>
                        <element name="column" type="xsd:int"/>
                        </sequence>
                    </extension>
                </complexContent>
            </complexType>

Commenting this out in the wsdl file is allowing me to make progress, but I'm not sure what the problem is.

09/20/05 18:10:24 changed by nahi

  • milestone changed from undefined to 1.5.6.

Hmm. According to the log, wsdl2ruby.rb is referring site_ruby directory (/usr/lib/ruby/*site_ruby*/1.8/wsdl/xmlSchema/sequence.rb, etc.). It must read bundled library directory (such as /usr/lib/ruby/1.8/wsdl/xmlSchema/sequence.rb).

Would you please once remove /usr/lib/ruby/site_ruby/1.8/{soap,wsdl,xsd} and install soap4r-1.5.5 again?

09/21/05 07:49:34 changed by mmay@localmatters.com

  • severity changed from normal to critical.

I am getting a similar error, apparently also with sequences:

ignored attr: {}abstract
F, [2005-09-20T16:28:14.397412 #3337] FATAL -- app: Detected an exception. Stopp ing ... undefined method `elementformdefault' for #<WSDL::XMLSchema::ComplexCont ent:0x..fdbee12ba> (NoMethodError)
/usr/lib/ruby/1.8/wsdl/xmlSchema/sequence.rb:33:in `elementformdefault'
/usr/lib/ruby/1.8/wsdl/xmlSchema/element.rb:87:in `elementform'
/usr/lib/ruby/1.8/wsdl/xmlSchema/element.rb:111:in `parse_attr'
/usr/lib/ruby/1.8/wsdl/parser.rb:143:in `decode_tag'
/usr/lib/ruby/1.8/wsdl/parser.rb:139:in `each'
/usr/lib/ruby/1.8/wsdl/parser.rb:139:in `decode_tag'
/usr/lib/ruby/1.8/wsdl/parser.rb:84:in `start_element'
/usr/lib/ruby/1.8/xsd/xmlparser/parser.rb:67:in `start_element'
/usr/lib/ruby/1.8/xsd/xmlparser/xmlscanner.rb:139:in `on_stag_end'
/usr/lib/ruby/1.8/xsd/xmlparser/xmlscanner.rb:134:in `on_stag_end_empty'
/usr/lib/site_ruby/1.8/xmlscan/scanner.rb:470:in `on_stag_end_empty'
/usr/lib/site_ruby/1.8/xmlscan/scanner.rb:794:in `scan_stag'
/usr/lib/site_ruby/1.8/xmlscan/scanner.rb:826:in `scan_content'
/usr/lib/site_ruby/1.8/xmlscan/scanner.rb:1051:in `scan_prolog'
/usr/lib/site_ruby/1.8/xmlscan/scanner.rb:1058:in `scan_document'
/usr/lib/site_ruby/1.8/xmlscan/scanner.rb:1073:in `parse'
/usr/lib/ruby/1.8/xsd/xmlparser/xmlscanner.rb:25:in `do_parse'
/usr/lib/ruby/1.8/wsdl/parser.rb:65:in `parse'
/usr/lib/ruby/1.8/wsdl/importer.rb:29:in `parse'
/usr/lib/site_ruby/1.8/wsdl/xmlSchema/importer.rb:30:in `import'
/usr/lib/ruby/1.8/wsdl/importer.rb:18:in `import'
/usr/lib/site_ruby/1.8/wsdl/soap/wsdl2ruby.rb:170:in `import'
/usr/lib/site_ruby/1.8/wsdl/soap/wsdl2ruby.rb:34:in `run'
./wsdl2ruby.rb:42:in `run'
/usr/lib/ruby/1.8/logger.rb:684:in `start'
./wsdl2ruby.rb:125
I, [2005-09-20T16:28:14.410564 #3337]  INFO -- app: End of app. (status: -1)

I installed the latest stable version of soap4r, and made sure that it is using the correct one (diff sequence.rb from the latest version against /usr/lib/ruby/1.8/wsdl/xmlSchema/sequence.rb says they are the same). Any ideas?

09/21/05 15:04:04 changed by wrex

I removed {soap,xsd,wsdl} from both /usr/lib/ruby/1.8 and /usr/lib/ruby/site_ruby/1.8 then re-installed with "ruby install.rb".

This actually re-installed in the site-ruby directory (with the same problem). The install.rb installs in site_ruby on my machine (which seems correct to me).

I didn't have the problem with 1_5_4, only with 1_5_5

09/21/05 21:07:19 changed by nahi

  • status changed from new to assigned.

I finally found the bug. I run wsdl2ruby.rb with partner.wsdl and found nothing but when I run wsdl2ruby.rb with enterprise.wsdl I found it. [1629] should fix the bug. Sorry for the degrade I introduced and thank you for patient report.

09/24/05 10:02:35 changed by wrex

Just wanted to confirm that [1629] does indeed fix the bug for me.

Thank you!

09/24/05 10:10:58 changed by nahi

Thank you for confirmation. I'll add some test then close this ticket.

09/27/05 23:31:11 changed by nahi

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

(In [1637]) add a test of complexContent + elementFormDefault. closes #151.

10/21/05 14:02:47 changed by nahi

  • component changed from soap4r to wsdl4r.