WSDL::Importer (Class)

In: wsdl/importer.rb
Parent: Object

Methods

import   import   new  

Public Class methods

[Source]

# File wsdl/importer.rb, line 19
  def self.import(location)
    new.import(location)
  end

[Source]

# File wsdl/importer.rb, line 23
  def initialize
    @web_client = nil
  end

Public Instance methods

[Source]

# File wsdl/importer.rb, line 27
  def import(location)
    content = nil
    if FileTest.exist?(location)
      content = File.open(location).read
    else
      client = web_client.new(nil, "WSDL4R")
      if opt = ::SOAP::Property.loadproperty(::SOAP::PropertyName)
        client.proxy = opt["client.protocol.http.proxy"]
        client.no_proxy = opt["client.protocol.http.no_proxy"]
      end
      client.proxy ||= ::SOAP::Env::HTTP_PROXY
      client.no_proxy ||= ::SOAP::Env::NO_PROXY
      content = client.get_content(location)
    end
    opt = {}
    begin
      WSDL::Parser.new(opt).parse(content)
    rescue WSDL::Parser::ParseError => orgexcn
      begin
        require 'wsdl/xmlSchema/parser'
        WSDL::XMLSchema::Parser.new(opt).parse(content)
      rescue
        raise orgexcn
      end
    end
  end

[Validate]