Created
April 6, 2011 10:28
-
-
Save rubiii/905451 to your computer and use it in GitHub Desktop.
Savon InterFAX example: Resubmit a Transaction
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
# more examples at: | |
# https://gist.github.com/903337 | |
require "rubygems" | |
# $ gem install savon (works with v0.9.1 and higher) | |
require "savon" | |
# convert hash key symbols to camelcase | |
Gyoku.convert_symbols_to(:camelcase) | |
# create a client using the InterFAX WSDL | |
client = Savon::Client.new("http://ws.interfax.net/dfs.asmx?wsdl") | |
# execute a request to the :re_send_fax action | |
response = client.request(:int, :re_send_fax) do | |
soap.body = { | |
:username => "your username", | |
:password => "your password", | |
:fax_number => "+18667700000", | |
:transaction_ID => 204700000 | |
} | |
end | |
# translate the response to a Hash and get the result | |
result = response[:re_send_fax_response][:re_send_fax_result] | |
# print the result. returns for example: "56778" (the Transaction ID) | |
p result |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment