Class | SOAP::SOAPBody |
In: |
soap/rpc/element.rb
soap/element.rb |
Parent: | SOAPStruct |
Add method definitions for RPC to common definition in element.rb
# File soap/element.rb, line 98 def initialize(data = nil, is_fault = false) super(nil) @elename = EleBodyName @encodingstyle = nil if data if data.respond_to?(:elename) add(data.elename.name, data) else data.to_a.each do |datum| add(datum.elename.name, datum) end end end @is_fault = is_fault end
# File soap/element.rb, line 114 def encode(generator, ns, attrs = {}) name = ns.name(@elename) generator.encode_tag(name, attrs) if @is_fault yield(@data) else @data.each do |data| yield(data) end end generator.encode_tag_end(name, true) end
# File soap/rpc/element.rb, line 57 def fault=(fault) @is_fault = true add_member('fault', fault) end
# File soap/rpc/element.rb, line 38 def outparams root = root_node if !@is_fault and !root.nil? and !root.is_a?(SOAPBasetype) op = root[1..-1] op = nil if op && op.empty? op else nil end end
# File soap/rpc/element.rb, line 22 def response root = root_node if !@is_fault if root.nil? nil elsif root.is_a?(SOAPBasetype) root else # Initial element is [retval]. root[0] end else root end end