Project

General

Profile

Actions

Backport #2361

closed

"undefined method in 'targetnamespace='" in wsdl/import after upgrading to Snow Leopard/1.8.7

Added by bill.gathen (Bill Gathen) about 15 years ago. Updated over 5 years ago.


Description

=begin
I upgraded to Snow Leopard yesterday and the 1.8.7 wsdlDriver suite doesn't like a wsdl file that 1.8.6 processed fine.

I'm running this call:
SOAP::WSDLDriverFactory.new("https://api.yieldmanager.com/api-1.30/contact.php?wsdl").create_rpc_driver

But when it tries to parse the 2nd line (<wsdl:import namespace="http://api.yieldmanager.com/types" location="xsd_gen.php"/>) it throws the following error:

NoMethodError: undefined method `targetnamespace=' for #WSDL::XMLSchema::Schema:0x8174b8b0
method parse_attr in import.rb at line 44
method decode_tag in parser.rb at line 143
method each in parser.rb at line 139
method decode_tag in parser.rb at line 139
method start_element in parser.rb at line 84
method start_element in parser.rb at line 67
method tag_start in rexmlparser.rb at line 34
method parse in streamparser.rb at line 24
method parse_stream in document.rb at line 201
method do_parse in rexmlparser.rb at line 27
method parse in parser.rb at line 65
method parse in importer.rb at line 29
method import in importer.rb at line 31
method import in importer.rb at line 18
method import in wsdlDriver.rb at line 124
method initialize in wsdlDriver.rb at line 28
method new in yield_manager.rb at line 40
method client_for in yield_manager.rb at line 40
method start_session in yield_manager.rb at line 56
method session in yield_manager.rb at line 47
method find_by_description in vurl_lookup.rb at line 15
method test_find_by_description in vurl_lookup_test.rb at line 12

The URL of the xsd_gen file is https://api.yieldmanager.com/api-1.30/xsd_gen.php

After much digging, I discovered that commenting-out this block from wsdl/import.rb (lines 43-45):

     if @content

@content.targetnamespace = @namespace
end

...allows the file to parse normally and my request to complete. However, the files don't appear to have changed between the 1.8.6 release I was using (ruby 1.8.6 (2008-08-11 patchlevel 287) [universal-darwin9.0]) and the 1.8.7 that comes with Snow Leopard (ruby 1.8.7 (2008-08-11 patchlevel 72) [universal-darwin10.0]), or if they have I can't find the change.

Any clue as to what might have changed and how I can move this fix out of the library and into my client? If it's non-standard XML, I'd like to point it out to their tech support team.

Thanks in advance,
Bill
=end

Actions #1

Updated by ujihisa (Tatsuhiro Ujihisa) almost 15 years ago

  • Status changed from Open to Assigned
  • Assignee set to authorNari (Narihiro Nakamura)

=begin

=end

Actions #2

Updated by ujihisa (Tatsuhiro Ujihisa) almost 15 years ago

  • Assignee changed from authorNari (Narihiro Nakamura) to nahi (Hiroshi Nakamura)

=begin

=end

Actions #3

Updated by candlerb (Brian Candler) over 14 years ago

=begin
Another wsdl which shows the same problem:
http://realtime.nationalrail.co.uk/ldbws/wsdl.aspx

Note that soap4r gem 1.5.8 also demonstrates this. e.g. try
wsdl2ruby.rb --type client --wsdl http://realtime.nationalrail.co.uk/ldbws/wsdl.aspx

My workaround is to change line 43 of gems/soap4r-1.5.8/lib/wsdl/import.rb to:

 if @content && @content.respond_to?(:targetnamespace=)

=end

Actions #4

Updated by jeremyevans0 (Jeremy Evans) over 5 years ago

  • Tracker changed from Bug to Backport
  • Project changed from Ruby 1.8 to Backport187
  • Description updated (diff)
  • Status changed from Assigned to Closed
  • ruby -v deleted (ruby 1.8.7 (2008-08-11 patchlevel 72) [universal-darwin10.0])
Actions

Also available in: Atom PDF

Like0
Like0Like0Like0Like0