Class: Agris::SavonRequest

Inherits:
Object
  • Object
show all
Defined in:
lib/agris/savon_request.rb

Instance Method Summary collapse

Constructor Details

#initialize(base_url, credentials, logger, log_level, proxy_url = nil) ⇒ SavonRequest

Returns a new instance of SavonRequest.



7
8
9
10
11
12
13
# File 'lib/agris/savon_request.rb', line 7

def initialize(base_url, credentials, logger, log_level, proxy_url = nil)
  @base_url = base_url
  @credentials = credentials
  @logger = logger
  @log_level = log_level
  @proxy_url = proxy_url
end

Instance Method Details

#process_message(context, message_number, input) ⇒ Object



15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
# File 'lib/agris/savon_request.rb', line 15

def process_message(context, message_number, input)
  response = client.call(
    :process_message,
    message: {
      AgContext_str_p: context,
      AgMessage_int_p: message_number,
      AgInput_obj_p: input
    }
  )
  message_response = parse_response(response)

  fail response_error(message_response.error_info) \
    if message_response.error?

  message_response
end