def call_softlayer_api_with_params(method_name, parameters, args)
      additional_headers = {};

      # The client knows about authentication, so ask him for the auth headers
      authentication_headers = self.client.authentication_headers
      additional_headers.merge!(authentication_headers)

      if parameters && parameters.server_object_filter
        additional_headers.merge!("#{@service_name}ObjectFilter" => parameters.server_object_filter)
      end

      # Object masks go into the headers too.
      if parameters && parameters.server_object_mask
        object_mask = parameters.server_object_mask
        additional_headers.merge!("SoftLayer_ObjectMask" => { "mask" => object_mask }) unless object_mask.empty?
      end

      # Result limits go into the headers
      if (parameters && parameters.server_result_limit)
        additional_headers.merge!("resultLimit" => { "limit" => parameters.server_result_limit, "offset" => (parameters.server_result_offset || 0) })
      end

      # Add an object id to the headers.
      if parameters && parameters.server_object_id
        additional_headers.merge!("#{@service_name}InitParameters" => { "id" => parameters.server_object_id })
      end

      # This is a workaround for a potential problem that arises from mis-using the
      # API. If you call SoftLayer_Virtual_Guest and you call the getObject method
      # but pass a virtual guest as a parameter, what happens is the getObject method
      # is called through an HTTP POST verb and the API creates a new VirtualServer that
      # is a copy of the one you passed in.
      #
      # The counter-intuitive creation of a new Virtual Server is unexpected and, even worse,
      # is something you can be billed for. To prevent that, we ignore the request
      # body on a "getObject" call and print out a warning.
      if (method_name == :getObject) && (nil != args) && (!args.empty?) then
        $stderr.puts "Warning - The getObject method takes no parameters. The parameters you have provided will be ignored."
        args = nil
      end

      # Collect all the different header pieces into a single hash that
      # will become the first argument to the call.
      call_headers = {
        "headers" => additional_headers
      }

      begin
        call_value = xmlrpc_client.call(method_name.to_s, call_headers, *args)
      rescue XMLRPC::FaultException => e
        puts "A XMLRPC Fault was returned #{e}" if $DEBUG
        raise
      end

      return call_value
    end
def call_softlayer_api_with_params(method_name, parameters, args)
      additional_headers = {};

      # The client knows about authentication, so ask him for the auth headers
      authentication_headers = self.client.authentication_headers
      additional_headers.merge!(authentication_headers)

      if parameters && parameters.server_object_filter
        additional_headers.merge!("#{@service_name}ObjectFilter" => parameters.server_object_filter)
      end

      # Object masks go into the headers too.
      if parameters && parameters.server_object_mask
        object_mask = parameters.server_object_mask
        additional_headers.merge!("SoftLayer_ObjectMask" => { "mask" => object_mask }) unless object_mask.empty?
      end

      # Result limits go into the headers
      if (parameters && parameters.server_result_limit)
        additional_headers.merge!("resultLimit" => { "limit" => parameters.server_result_limit, "offset" => (parameters.server_result_offset || 0) })
      end

      # Add an object id to the headers.
      if parameters && parameters.server_object_id
        additional_headers.merge!("#{@service_name}InitParameters" => { "id" => parameters.server_object_id })
      end

      # This is a workaround for a potential problem that arises from mis-using the
      # API. If you call SoftLayer_Virtual_Guest and you call the getObject method
      # but pass a virtual guest as a parameter, what happens is the getObject method
      # is called through an HTTP POST verb and the API creates a new VirtualServer that
      # is a copy of the one you passed in.
      #
      # The counter-intuitive creation of a new Virtual Server is unexpected and, even worse,
      # is something you can be billed for. To prevent that, we ignore the request
      # body on a "getObject" call and print out a warning.
      if (method_name == :getObject) && (nil != args) && (!args.empty?) then
        $stderr.puts "Warning - The getObject method takes no parameters. The parameters you have provided will be ignored."
        args = nil
      end

      # Collect all the different header pieces into a single hash that
      # will become the first argument to the call.
      call_headers = {
        "headers" => additional_headers
      }

      begin
        call_value = xmlrpc_client.call(method_name.to_s, call_headers, *args)
      rescue XMLRPC::FaultException => e
        puts "A XMLRPC Fault was returned #{e}" if $DEBUG
        raise
      end

      return call_value
    end
Issue an HTTP request to call the given method from the SoftLayer API with
 the parameters and arguments given.

 Parameters are information _about_ the call, the object mask or the
 particular object in the SoftLayer API you are calling.

 Arguments are the arguments to the SoftLayer method that you wish to
 invoke.

 This is intended to be used in the internal
 processing of method_missing and need not be called directly.