Class: ApiBanking::SoapClient
- Inherits:
-
Object
- Object
- ApiBanking::SoapClient
- Defined in:
- lib/api_banking/soap/soap_client.rb
Direct Known Subclasses
DomesticRemittanceByPartnerService, FundsTransferByCustomerService, FundsTransferByCustomerService2, InstantCreditService, InstantMoneyTransferService, NotificationService
Class Method Summary collapse
Class Method Details
.do_remote_call(&block) ⇒ Object
5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 |
# File 'lib/api_banking/soap/soap_client.rb', line 5 def self.do_remote_call(&block) data = construct_envelope(&block) = {} [:method] = :post [:body] = data.to_xml [:headers] = {'Content-Type' => "application/xml; charset=utf-8"} # SOAPAction header is not allowed for Soap12 # options[:headers][:SOAPAction] = data.doc.at_xpath('/soapenv12:Envelope/soapenv12:Body/*', 'soapenv12' => 'http://www.w3.org/2003/05/soap-envelope').name [:proxy] = self.configuration.proxy [:timeout] = self.configuration.timeout () [:headers]['User-Agent'] = "Quantiguous; API Banking, Ruby Gem #{ApiBanking::VERSION}" request = Typhoeus::Request.new(self.configuration.environment.endpoints[self.name.split('::').last.to_sym], ) response = request.run parse_response(response) end |