Class: AuthenticationNewsessRequest

Inherits:
AuthenticationRequest show all
Defined in:
lib/refworks/authentication/newsess/authentication_newsess_request.rb

Class Method Summary collapse

Methods inherited from AuthenticationRequest

call_class, generate_class_params

Methods inherited from Request

generate_signature

Class Method Details

.call_methodObject



3
4
5
# File 'lib/refworks/authentication/newsess/authentication_newsess_request.rb', line 3

def self.call_method
  'newsess'
end

.generate_request_info(params) ⇒ Object



11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
# File 'lib/refworks/authentication/newsess/authentication_newsess_request.rb', line 11

def self.generate_request_info(params)

  class_name = call_class()
  method_name = call_method()

  # query parameters for the newsess call
  query_string_params = {
      :class => class_name,
      :method => method_name,
  }

  # Construct the XML payload for the newsess call.
   = params[:login_name]
  password = params[:password]
  group_code = params[:group_code]

  message_body = "    <RWRequest class=\"authentication\" method=\"newsess\">\n      <AcctInfo loginName=\"\#{login_name}\" groupCode=\"\#{group_code}\" password=\"\#{password}\"></AcctInfo>\n    </RWRequest>\n  EOS\n\n  # return the request info\n  {:params => query_string_params, :body => message_body, :headers => {'Content-type' => 'text/xml'}}\nend\n"

.http_request_verbObject



7
8
9
# File 'lib/refworks/authentication/newsess/authentication_newsess_request.rb', line 7

def self.http_request_verb
  'POST'
end