method

unmarshal

ruby latest stable - Class: SOAP::RPC::Router

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.

unmarshal(conn_data)
private

No documentation available.

# File lib/soap/rpc/router.rb, line 270
  def unmarshal(conn_data)
    opt = {}
    contenttype = conn_data.receive_contenttype
    if /#{MIMEMessage::MultipartContentType}/i =~ contenttype
      opt[:external_content] = {}
      mime = MIMEMessage.parse("Content-Type: " + contenttype,
        conn_data.receive_string)
      mime.parts.each do |part|
        value = Attachment.new(part.content)
        value.contentid = part.contentid
        obj = SOAPAttachment.new(value)
        opt[:external_content][value.contentid] = obj if value.contentid
      end
      opt[:charset] =
        StreamHandler.parse_media_type(mime.root.headers['content-type'].str)
      env = Processor.unmarshal(mime.root.content, opt)
    else
      opt[:charset] = ::SOAP::StreamHandler.parse_media_type(contenttype)
      env = Processor.unmarshal(conn_data.receive_string, opt)
    end
    charset = opt[:charset]
    conn_data.send_contenttype = "text/xml; charset=\"#{charset}\""
    env
  end