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