Class: XPlanner::SoapClient

Inherits:
Object
  • Object
show all
Defined in:
lib/helpers/xplanner_soap_client.rb

Instance Method Summary collapse

Constructor Details

#initialize(params) ⇒ SoapClient

Returns a new instance of SoapClient.



3
4
5
6
7
8
# File 'lib/helpers/xplanner_soap_client.rb', line 3

def initialize( params )
  @client = Savon.client do |wsdl, http|
    wsdl.document = params[:wsdl]
    http.auth.basic params[:username], params[:password]
  end
end

Instance Method Details

#call(rpc, payload = nil) ⇒ Object

throws exception if xplanner doesn’t like it.



19
20
21
# File 'lib/helpers/xplanner_soap_client.rb', line 19

def call( rpc, payload=nil)
  @client.request( rpc ) { soap.body = payload unless payload.nil? }
end

#confirm_connectionObject



10
11
12
13
14
15
16
# File 'lib/helpers/xplanner_soap_client.rb', line 10

def confirm_connection
  begin
    return @client.wsdl.soap_actions.include? :get_user_story
  rescue
    return false
  end
end