public Method

SOAPGenerator.encode_data(ns, obj, parent)

There's no documentation for this item.

Source Code

# File soap/generator.rb, line 68
def encode_data(ns, obj, parent)
  if obj.is_a?(SOAPEnvelopeElement)
    encode_element(ns, obj, parent)
    return
  end
  if @reftarget && !obj.precedents.empty?
    add_reftarget(obj.elename.name, obj)
    ref = SOAPReference.new(obj)
    ref.elename = ref.elename.dup_name(obj.elename.name)
    obj.precedents.clear      # Avoid cyclic delay.
    obj.encodingstyle = parent.encodingstyle
    # SOAPReference is encoded here.
    obj = ref
  end
  encodingstyle = obj.encodingstyle
  # Children's encodingstyle is derived from its parent.
  encodingstyle ||= parent.encodingstyle if parent
  obj.encodingstyle = encodingstyle
  handler = find_handler(encodingstyle || @default_encodingstyle)
  unless handler
    raise FormatEncodeError.new("Unknown encodingStyle: #{ encodingstyle }.")
  end
  if !obj.elename.name
    raise FormatEncodeError.new("Element name not defined: #{ obj }.")
  end
  handler.encode_data(self, ns, obj, parent)
  handler.encode_data_end(self, ns, obj, parent)
end
Comments

Have your say
Please use Textile formatting (click here for a cheat sheet). Use <code/> and <pre/> for code samples.
Click here to login with OpenID to to post comments.