def build_function_imports
    # Fill in the function imports
    functions = @edmx.xpath("//edm:EntityContainer/edm:FunctionImport", @ds_namespaces)
    functions.each do |f|
      http_method_attribute = f.xpath("@m:HttpMethod", @ds_namespaces).first # HttpMethod is no longer required http://www.odata.org/2011/10/actions-in-odata/
      is_side_effecting_attribute = f.xpath("@edm:IsSideEffecting", @ds_namespaces).first

      http_method = 'POST' # default to POST

      if http_method_attribute
        http_method = http_method_attribute.content
      elsif is_side_effecting_attribute
        is_side_effecting = is_side_effecting_attribute.content
        http_method = is_side_effecting ? 'POST' : 'GET'
      end

      return_type = f["ReturnType"]
      inner_return_type = nil
      unless return_type.nil?
        return_type = (return_type =~ /^Collection/) ? Array : convert_to_local_type(return_type)
        if f["ReturnType"] =~ /\((.*)\)/
          inner_return_type = convert_to_local_type($~[1])
        end
      end
      params = f.xpath("edm:Parameter", @ds_namespaces)
      parameters = nil
      if params.length > 0
        parameters = {}
        params.each do |p|
          parameters[p["Name"]] = p["Type"]
        end
      end
      @function_imports[f["Name"]] = {
        :http_method => http_method,
        :return_type => return_type,
        :inner_return_type => inner_return_type,
        :parameters => parameters }
    end
  end
def build_function_imports
    # Fill in the function imports
    functions = @edmx.xpath("//edm:EntityContainer/edm:FunctionImport", @ds_namespaces)
    functions.each do |f|
      http_method_attribute = f.xpath("@m:HttpMethod", @ds_namespaces).first # HttpMethod is no longer required http://www.odata.org/2011/10/actions-in-odata/
      is_side_effecting_attribute = f.xpath("@edm:IsSideEffecting", @ds_namespaces).first

      http_method = 'POST' # default to POST

      if http_method_attribute
        http_method = http_method_attribute.content
      elsif is_side_effecting_attribute
        is_side_effecting = is_side_effecting_attribute.content
        http_method = is_side_effecting ? 'POST' : 'GET'
      end

      return_type = f["ReturnType"]
      inner_return_type = nil
      unless return_type.nil?
        return_type = (return_type =~ /^Collection/) ? Array : convert_to_local_type(return_type)
        if f["ReturnType"] =~ /\((.*)\)/
          inner_return_type = convert_to_local_type($~[1])
        end
      end
      params = f.xpath("edm:Parameter", @ds_namespaces)
      parameters = nil
      if params.length > 0
        parameters = {}
        params.each do |p|
          parameters[p["Name"]] = p["Type"]
        end
      end
      @function_imports[f["Name"]] = {
        :http_method => http_method,
        :return_type => return_type,
        :inner_return_type => inner_return_type,
        :parameters => parameters }
    end
  end
Parses the function imports and fills the @function_imports collection