Need help using Savon gem! (SOAP)

G

ghettoiam

I'm trying to use this "Sendfax" method defined here:
https://ws.interfax.net/dfs.asmx?WSDL. I can't seem to a set a
properly format the request however. Previously I was using
SOAP::WSDLDriverFactory and was succesfully using the service, but
inside a rails application it could not find the "SOAP" module. A
fair bit of time was spent with no resolution.

I read good things about SAVON (http://github.com/rubiii/savon) but I
can't seem to get it to work in a test or in a project. If anyone is
familiar with Savon, I'd -really- appreciate some help as I am stumped
as to why this isn't working.

I have some straight-forward code:

def client
@client ||= Savon::Client.new "https://ws.interfax.net/dfs.asmx?
WSDL"
end

def send_fax(username="foo", password="bar", fax_number=nil, data=nil)

@response = client.sendfax do |soap|
soap.body = {:Username => username,
:password => password,
:FaxNumber => fax_number,
:FileData => data,
:FileType => "HTML"}
end
end
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Members online

Forum statistics

Threads
473,968
Messages
2,570,149
Members
46,695
Latest member
StanleyDri

Latest Threads

Top