Class: XPlanner::SoapClient
- Inherits:
-
Object
- Object
- XPlanner::SoapClient
- Defined in:
- lib/helpers/xplanner_soap_client.rb
Instance Method Summary collapse
-
#call(rpc, payload = nil) ⇒ Object
throws exception if xplanner doesn’t like it.
- #confirm_connection ⇒ Object
-
#initialize(params) ⇒ SoapClient
constructor
A new instance of SoapClient.
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_connection ⇒ Object
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 |