I want to use a financial institution webservice to "verifyTransaction" The method gets two strings as input and return a double as output.
double verifyTransaction (
String RefNum,
String MerchantID
)
I used Savon in rails 3.1 to call the method.
client = Savon::Client.new do |wsdl|
wsdl.document = "https://acquirer.sb24.com/ref-payment/ws/ReferencePayment?WSDL"
end
response = client.request :wsdl, "verifyTransaction" do
soap.body ={"RefNum" => "ReferenceNumber", "MerchantID" => "MymerchantId"}
end
but the I got this error:
Savon::SOAP::Fault ((env:Client) caught exception while handling request: unexpected encoding style: expected=http://schemas.xmlsoap.org/soap/encoding/, actual=)
Any thought on how to solve this?
I solved the problem by using SoapUI.
I've opened the WSDL in SoapUI, generate a sample requests and copy/paste it into Savon like this:
client = Savon::Client.new do |wsdl|
wsdl.document = "https://acquirer.sb24.com/ref-payment/ws/ReferencePayment?WSDL"
end
response = client.request "verifyTransaction" do
soap.xml = 'XML will be here'
end
It worked fine! :)