/tools/Ruby/lib/ruby/1.8/wsdl/importer.rb

http://github.com/agross/netopenspace · Ruby · 38 lines · 21 code · 12 blank · 5 comment · 0 complexity · ee875dd52d4f9846d2286d5e30ecd674 MD5 · raw file

  1. # WSDL4R - WSDL importer library.
  2. # Copyright (C) 2003, 2005 NAKAMURA, Hiroshi <nahi@ruby-lang.org>.
  3. # This program is copyrighted free software by NAKAMURA, Hiroshi. You can
  4. # redistribute it and/or modify it under the same terms of Ruby's license;
  5. # either the dual license version in 2003, or any later version.
  6. require 'wsdl/xmlSchema/importer'
  7. require 'wsdl/parser'
  8. module WSDL
  9. class Importer < WSDL::XMLSchema::Importer
  10. def self.import(location, originalroot = nil)
  11. new.import(location, originalroot)
  12. end
  13. private
  14. def parse(content, location, originalroot)
  15. opt = {
  16. :location => location,
  17. :originalroot => originalroot
  18. }
  19. begin
  20. WSDL::Parser.new(opt).parse(content)
  21. rescue WSDL::Parser::ParseError
  22. super(content, location, originalroot)
  23. end
  24. end
  25. end
  26. end