6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
|
# File 'app/models/sms_queue.rb', line 6
def self.send_sms_message(params)
Rails.logger.info "Parameters #{params}"
Rails.logger.info "Logging in as #{params[:name]}"
Rails.logger.info "Password is #{params[:password]}"
Savon.env_namespace = :soap
client = Savon::Client.new do
wsdl.document = "http://www.services.dynmark.com/WebServices/MessagingServicesWS.asmx?WSDL"
wsdl.soap_actions
end
Rails.logger.info client.wsdl.soap_actions
response = client.request("SendMessage") do
http.["SOAPAction"] = '"http://www.services.dynmark.com/SendMessage"'
soap.input = ["SendMessage", {"xmlns" => "http://www.services.dynmark.com/"}]
soap.element_form_default = false
soap.body = {
:name => params[:name],
:password => params[:password],
:originator => params[:originator],
:text => params[:text],
:recipient => params[:recipient]
}
end
if response.success?
response.body
else
"Failed"
end
end
|