Sha256: 915099f32e08be66631c8ef72d5317a8a12ca532a79bcb080f47d154203ef0a4

Contents?: true

Size: 779 Bytes

Versions: 15

Compression:

Stored size: 779 Bytes

Contents

module LolSoap
  class Fault
    attr_reader :request, :node

    def initialize(request, node)
      @request = request
      @node    = node
    end

    def soap_namespace
      request.soap_namespace
    end

    def soap_version
      request.soap_version
    end

    def code
      node.at_xpath(
        soap_version == '1.2' ? './soap:Code/soap:Value' : './faultcode',
        'soap' => soap_namespace
      ).text.to_s
    end

    def reason
      node.at_xpath(
        soap_version == '1.2' ? './soap:Reason/soap:Text' : './faultstring',
        'soap' => soap_namespace
      ).text.to_s
    end

    def detail
      node.at_xpath(
        soap_version == '1.2' ? './soap:Detail/*' : './detail/*',
        'soap' => soap_namespace
      ).to_xml
    end
  end
end

Version data entries

15 entries across 15 versions & 1 rubygems

Version Path
lolsoap-0.11.0 lib/lolsoap/fault.rb
lolsoap-0.10.0 lib/lolsoap/fault.rb
lolsoap-0.9.0 lib/lolsoap/fault.rb
lolsoap-0.8.3 lib/lolsoap/fault.rb
lolsoap-0.8.2 lib/lolsoap/fault.rb
lolsoap-0.8.1 lib/lolsoap/fault.rb
lolsoap-0.8.0 lib/lolsoap/fault.rb
lolsoap-0.7.0 lib/lolsoap/fault.rb
lolsoap-0.6.1 lib/lolsoap/fault.rb
lolsoap-0.6.0 lib/lolsoap/fault.rb
lolsoap-0.5.1 lib/lolsoap/fault.rb
lolsoap-0.5.0 lib/lolsoap/fault.rb
lolsoap-0.4.2 lib/lolsoap/fault.rb
lolsoap-0.4.1 lib/lolsoap/fault.rb
lolsoap-0.4.0 lib/lolsoap/fault.rb