Sha256: 86cc812bc2c986eef5dd2917821c10899e088f55916238fd08625e7e45a25fe3
Contents?: true
Size: 1.16 KB
Versions: 3
Compression:
Stored size: 1.16 KB
Contents
require "wasabi" require "httpi/request" module Savon module Wasabi # = Savon::Wasabi::Document # # Extends the document handling of the <tt>Wasabi::Document</tt> by # adding support for remote and local WSDL documents. class Document < ::Wasabi::Document # Hooks into Wasabi and extends its document handling. def xml @xml ||= document.kind_of?(String) ? resolve_document : document end # Sets the <tt>HTTPI::Request</tt> for remote WSDL documents. attr_writer :request private # Sets up and returns the <tt>HTTPI::Request</tt>. def request @request ||= HTTPI::Request.new @request.url = document @request end # Resolves and returns the raw WSDL document. def resolve_document case document when /^http[s]?:/ then response = HTTPI.get(request) if response.error? raise Savon::HTTP::Error.new(response) else response.body end when /^</ then document else File.read(document) end end end end end
Version data entries
3 entries across 3 versions & 1 rubygems
Version | Path |
---|---|
savon-1.1.0 | lib/savon/wasabi/document.rb |
savon-1.0.0 | lib/savon/wasabi/document.rb |
savon-0.9.14 | lib/savon/wasabi/document.rb |