Class: IccsSoap::SecurityService

Inherits:
Object
  • Object
show all
Defined in:
lib/iccs-soap/security_service.rb

Class Method Summary collapse

Class Method Details

.loginObject

opens a new session



5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
# File 'lib/iccs-soap/security_service.rb', line 5

def 
  @client = Savon.client(
    :log => $soap_log,
    :wsdl => IccsSoap::Config.security_service.document_url,
    :endpoint => IccsSoap::Config.security_service.endpoint_url,
    :namespace => IccsSoap::Config.security_service.namespace_url
  )

  @response = @client.call(:login, :message => {
    :userName => IccsSoap::Config.security_service.user,
    :password => IccsSoap::Config.security_service.password
  })
  @client
rescue => e
  {e => e.backtrace.join("\n")}
end

.logoutObject

ends the session



23
24
25
26
27
28
# File 'lib/iccs-soap/security_service.rb', line 23

def logout
  @response = @client.request :logout
  remove_instance_variable @client
rescue => e
  {e => e.backtrace.join("\n")}
end