method

body_from_obj

ruby latest stable - Class: SOAP::WSDLDriver::Servant__

Method deprecated or moved

This method is deprecated or moved on the latest stable version. The last existing version (v1_8_7_330) is shown here.

body_from_obj(obj, op_info)
private

No documentation available.

# File lib/soap/wsdlDriver.rb, line 485
    def body_from_obj(obj, op_info)
      if obj.is_a?(SOAPBody)
        obj
      elsif op_info.bodyparts.empty?
        if obj.nil?
          nil
        else
          raise RuntimeError.new("no body found in schema")
        end
      elsif op_info.bodyparts.size == 1
        part = op_info.bodyparts[0]
        ele = bodyitem_from_obj(obj, part.element || part.type)
        SOAPBody.new(ele)
      else
        body = SOAPBody.new
        op_info.bodyparts.each do |part|
          child = Mapping.get_attribute(obj, part.name)
          ele = bodyitem_from_obj(child, part.element || part.type)
          body.add(ele.elename.name, ele)
        end
        body
      end
    end