class Soap
Public Class Methods
new(username, password)
click to toggle source
# File lib/soap.rb, line 5 def initialize(username, password) @username = username @password = password @sendUrl = sprintf @@path,"send" @receiveUrl = sprintf @@path,"receive" @voiceUrl = sprintf @@path,"Voice" @scheduleUrl = sprintf @@path,"Schedule" end
Public Instance Methods
add_usance(to, from, text, isflash, scheduleStartDateTime, repeatAfterDays, scheduleEndDateTime)
click to toggle source
# File lib/soap.rb, line 261 def add_usance(to, from, text, isflash, scheduleStartDateTime, repeatAfterDays, scheduleEndDateTime) client = Savon.client(wsdl: @scheduleUrl) data = { :to => to, :from => from, :text => text, :scheduleStartDateTime => scheduleStartDateTime, :repeatAfterDays => repeatAfterDays, :scheduleEndDateTime => scheduleEndDateTime, :isflash => isflash } response = client.call(:add_usance, message:data.merge(get_data)) response.body end
get_credit()
click to toggle source
# File lib/soap.rb, line 19 def get_credit client = Savon.client(wsdl: @sendUrl) response = client.call(:get_credit, message:get_data) response.body end
get_data()
click to toggle source
# File lib/soap.rb, line 13 def get_data { :username => @username, :password => @password } end
get_inbox_count(isRead=false)
click to toggle source
# File lib/soap.rb, line 172 def get_inbox_count(isRead=false) client = Savon.client(wsdl: @sendUrl) data = { :isRead => isRead } response = client.call(:get_inbox_count, message:data.merge(get_data)) response.body end
get_messages(location, index, count, from="")
click to toggle source
# File lib/soap.rb, line 96 def get_messages(location, index, count, from="") client = Savon.client(wsdl: @sendUrl) data = { :location => location, :from => from, :index => index, :count => count } response = client.call(:get_messages, message:data.merge(get_data)) response.body end
get_messages_by_date( location, index, count, dateFrom, dateTo, from="")
click to toggle source
# File lib/soap.rb, line 118 def get_messages_by_date( location, index, count, dateFrom, dateTo, from="") client = Savon.client(wsdl: @receiveUrl) data = { :location => location, :from => from, :index => index, :count => count, :dateFrom => dateFrom, :dateTo => dateTo } response = client.call(:get_messages_by_date, message:data.merge(get_data)) response.body end
get_messages_receptions(msgId, fromRows)
click to toggle source
# File lib/soap.rb, line 131 def get_messages_receptions(msgId, fromRows) client = Savon.client(wsdl: @receiveUrl) data = { :msgId => msgId, :fromRows => fromRows } response = client.call(:get_messages_receptions, message:data.merge(get_data)) response.body end
get_messages_str(location, index, count, from="")
click to toggle source
# File lib/soap.rb, line 107 def get_messages_str(location, index, count, from="") client = Savon.client(wsdl: @receiveUrl) data = { :location => location, :from => from, :index => index, :count => count } response = client.call(:get_message_str, message:data.merge(get_data)) response.body end
get_multi_delivery(recId)
click to toggle source
# File lib/soap.rb, line 211 def get_multi_delivery(recId) client = Savon.client(wsdl: @sendUrl) data = { :recId => recId } response = client.call(:get_multi_delivery2, message:data.merge(get_data)) response.body end
get_price(irancellCount, mtnCount, from, text)
click to toggle source
# File lib/soap.rb, line 161 def get_price(irancellCount, mtnCount, from, text) client = Savon.client(wsdl: @sendUrl) data = { :irancellCount => irancellCount, :mtnCount => mtnCount, :from => from, :text => text } response = client.call(:get_sms_price, message:data.merge(get_data)) response.body end
get_schedule_status(scheduleId)
click to toggle source
# File lib/soap.rb, line 245 def get_schedule_status(scheduleId) client = Savon.client(wsdl: @scheduleUrl) data = { :scheduleId => scheduleId } response = client.call(:get_schedule_status, message:data.merge(get_data)) response.body end
get_send_with_speech(recId)
click to toggle source
# File lib/soap.rb, line 203 def get_send_with_speech(recId) client = Savon.client(wsdl: @voiceUrl) data = { :recId => recId } response = client.call(:get_send_sms_with_speech_text_status, message:data.merge(get_data)) response.body end
get_users_messages_by_date(location, index, count, from,dateFrom, dateTo)
click to toggle source
# File lib/soap.rb, line 140 def get_users_messages_by_date(location, index, count, from,dateFrom, dateTo) client = Savon.client(wsdl: @receiveUrl) data = { :location => location, :from => from, :index => index, :count => count, :dateFrom => dateFrom, :dateTo => dateTo } response = client.call(:get_users_messages_by_date, message:data.merge(get_data)) response.body end
is_delivered(recId)
click to toggle source
# File lib/soap.rb, line 24 def is_delivered recId client = Savon.client(wsdl: @sendUrl) response = nil if recId.kind_of?(Array) data = { :recIds => recId } response = client.call(:get_deliveries, message:data.merge(get_data)) else data = { :recId => recId } response = client.call(:get_delivery, message:data.merge(get_data)) end response.body end
remove(msgIds)
click to toggle source
# File lib/soap.rb, line 153 def remove(msgIds) client = Savon.client(wsdl: @receiveUrl) data = { :msgIds => msgIds } response = client.call(:remove_messages2, message:data.merge(get_data)) response.body end
remove_schedule(scheduleId)
click to toggle source
# File lib/soap.rb, line 253 def remove_schedule(scheduleId) client = Savon.client(wsdl: @scheduleUrl) data = { :scheduleId => scheduleId } response = client.call(:remove_schedule, message:data.merge(get_data)) response.body end
send(to, from, text, isflash=false)
click to toggle source
# File lib/soap.rb, line 40 def send(to, from, text, isflash=false) client = Savon.client(wsdl: @sendUrl) response = nil data = { :to => to, :from => from, :text => text, :isflash => isflash } if to.kind_of?(Array) response = client.call(:send_simple_sms, message:data.merge(get_data)) else response = client.call(:send_simple_sms2, message:data.merge(get_data)) end response.body end
send2(to, from, text, isflash= false,udh="")
click to toggle source
# File lib/soap.rb, line 56 def send2(to, from, text, isflash= false,udh="") client = Savon.client(wsdl: @sendUrl) to = to.kind_of?(Array) ? to : [to] data = { :to => to, :from => from, :text => text, :isflash => isflash, :udh => udh } response = client.call(:send_sms, message:data.merge(get_data)) response.body end
send_by_base_number(text, to, bodyId)
click to toggle source
# File lib/soap.rb, line 81 def send_by_base_number(text, to, bodyId) client = Savon.client(wsdl: @sendUrl) response = nil data = { :text => text, :to => to, :bodyId => bodyId } if text.kind_of?(Array) response = client.call(:send_by_base_number, message:data.merge(get_data)) else response = client.call(:send_by_base_number2, message:data.merge(get_data)) end response.body end
send_multiple_schedule(to, from, text, isflash, scheduleDateTime, period)
click to toggle source
# File lib/soap.rb, line 219 def send_multiple_schedule(to, from, text, isflash, scheduleDateTime, period) client = Savon.client(wsdl: @scheduleUrl) data = { :to => to, :from => from, :text => text, :isflash => isflash, :scheduleDateTime => scheduleDateTime, :period => period } response = client.call(:add_multiple_schedule, message:data.merge(get_data)) response.body end
send_schedule(to, from, text, isflash, scheduleDateTime, period)
click to toggle source
# File lib/soap.rb, line 232 def send_schedule(to, from, text, isflash, scheduleDateTime, period) client = Savon.client(wsdl: @scheduleUrl) data = { :to => to, :from => from, :text => text, :isflash => isflash, :scheduleDateTime => scheduleDateTime, :period => period } response = client.call(:add_schedule, message:data.merge(get_data)) response.body end
send_with_domain(to, from, text, isflash, domainName)
click to toggle source
# File lib/soap.rb, line 69 def send_with_domain(to, from, text, isflash, domainName) client = Savon.client(wsdl: @sendUrl) data = { :to => to, :from => from, :text => text, :isflash => isflash, :domainName => domainName } response = client.call(:send_with_domain, message:data.merge(get_data)) response.body end
send_with_speech(to, from, text, speech)
click to toggle source
# File lib/soap.rb, line 180 def send_with_speech(to, from, text, speech) client = Savon.client(wsdl: @voiceUrl) data = { :to => to, :from => from, :smsBody => text, :speechBody => speech } response = client.call(:send_sms_with_speech_text, message:data.merge(get_data)) response.body end
send_with_speech_schdule_date(to, from, text, speech, scheduleDate)
click to toggle source
# File lib/soap.rb, line 191 def send_with_speech_schdule_date(to, from, text, speech, scheduleDate) client = Savon.client(wsdl: @voiceUrl) data = { :to => to, :from => from, :smsBody => text, :speechBody => speech, :scheduleDate => scheduleDate } response = client.call(:send_sms_with_speech_text_by_schdule_date, message:data.merge(get_data)) response.body end