method

fetch

fetch(location)
private

No documentation available.

# File lib/wsdl/xmlSchema/importer.rb, line 45
  def fetch(location)
    warn("importing: #{location}") if $DEBUG
    content = nil
    if location.scheme == 'file' or
        (location.relative? and FileTest.exist?(location.path))
      content = File.open(location.path).read
    elsif location.scheme and location.scheme.size == 1 and
        FileTest.exist?(location.to_s)
      # ToDo: remove this ugly workaround for a path with drive letter
      # (D://foo/bar)
      content = File.open(location.to_s).read
    else
      client = web_client.new(nil, "WSDL4R")
      client.proxy = ::SOAP::Env::HTTP_PROXY
      client.no_proxy = ::SOAP::Env::NO_PROXY
      if opt = ::SOAP::Property.loadproperty(::SOAP::PropertyName)
        ::SOAP::HTTPConfigLoader.set_options(client,
          opt["client.protocol.http"])
      end
      content = client.get_content(location)
    end
    content
  end