lib/sepa/client.rb
# Sends request to the bank specified in the attributes. First a new {SoapBuilder} class is
# initialized with a hash of the parameters given to the client with the {#create_hash} method.
# After this, a Savon client is initialized with a WSDL file got from {#wsdl}. After this, the
# Savon client makes the actual call to the server with the {#command} and the constructed
# {SoapBuilder}. After the call, the xml is extracted from the Savon response and the response
# is then checked for any Savon::Error errors. After this a {Response} is initialized using
# the {#initialize_response} method with the xml response and possible errors.
# @raise [ArgumentError] if some of the parameters are not valid
# @return [Response]
Sends request to the bank specified in the attributes. First a new {SoapBuilder} class is
initialized with a hash of the parameters given to the client with the {#create_hash} method.
After this, a Savon client is initialized with a WSDL file got from {#wsdl}. After this, the
Savon client makes the actual call to the server with the {#command} and the constructed
{SoapBuilder}. After the call, the xml is extracted from the Savon response and the response
is then checked for any Savon::Error errors. After this a {Response} is initialized using
the {#initialize_response} method with the xml response and possible errors.
Sends request to the bank specified in the attributes . First a new { SoapBuilder } class is initialized with a hash of the parameters given to the client with the { #create_hash } method . After this a Savon client is initialized with a WSDL file got from { #wsdl } . After this the Savon client makes the actual call to the server with the { #command } and the constructed { SoapBuilder } . After the call the xml is extracted from the Savon response and the response is then checked for any Savon :: Error errors . After this a { Response } is initialized using the { #initialize_response } method with the xml response and possible errors .
def send_request
      raise ArgumentError, errors.messages unless valid?
      client = Savon.client(savon_globals)
      begin
        error = nil
        response = client.call(soap_command, savon_locals)
        response &&= response.to_xml
      rescue Savon::Error => e
        response = nil
        error = e.http.body
      end
      initialize_response(error, response)
    end
def send_request raise ArgumentError , errors . messages unless valid? client = Savon . client ( savon_globals ) begin error = nil response = client . call ( soap_command , savon_locals ) response &&= response . to_xml rescue Savon :: Error => e response = nil error = e . http . body end initialize_response ( error , response ) end
Sends request to the bank specified in the attributes.
Sends request to the bank specified in the attributes .
None
Response
[ArgumentError] if some of the parameters are not valid
[ ArgumentError ] if some of the parameters are not valid