Class: WSDL::Response::FaultParser Private

Inherits:
Object
  • Object
show all
Defined in:
lib/wsdl/response/fault_parser.rb

Overview

This class is part of a private API. You should avoid using this class if possible, as it may be removed or be changed in the future.

Parses SOAP fault elements from a response document.

Handles both SOAP 1.1 and 1.2 fault structures, producing a normalized Fault data object.

Class Method Summary collapse

Instance Method Summary collapse

Constructor Details

#initialize(doc) ⇒ FaultParser

This method is part of a private API. You should avoid using this method if possible, as it may be removed or be changed in the future.

Returns a new instance of FaultParser.

Parameters:

  • doc (Nokogiri::XML::Document)

    the parsed response document



25
26
27
# File 'lib/wsdl/response/fault_parser.rb', line 25

def initialize(doc)
  @doc = doc
end

Class Method Details

.parse(doc) ⇒ Fault?

This method is part of a private API. You should avoid using this method if possible, as it may be removed or be changed in the future.

Parses a SOAP fault from the given XML document.

Parameters:

  • doc (Nokogiri::XML::Document)

    the parsed response document

Returns:

  • (Fault, nil)

    the parsed fault, or nil if no fault is present



20
21
22
# File 'lib/wsdl/response/fault_parser.rb', line 20

def self.parse(doc)
  new(doc).parse
end

Instance Method Details

#parseFault?

This method is part of a private API. You should avoid using this method if possible, as it may be removed or be changed in the future.

Returns the parsed fault, or nil if no fault is present.

Returns:

  • (Fault, nil)

    the parsed fault, or nil if no fault is present



30
31
32
33
34
35
36
37
38
39
# File 'lib/wsdl/response/fault_parser.rb', line 30

def parse
  node = fault_node
  return unless node

  if node.namespace&.href == NS::SOAP_1_2
    parse_soap_1_2_fault(node)
  else
    parse_soap_1_1_fault(node)
  end
end