lib/esendex4soap.rb in esendex4soap-0.6.0 vs lib/esendex4soap.rb in esendex4soap-0.6.1
- old
+ new
@@ -50,18 +50,28 @@
@log.debug "#{@message_kind}:#{text.scan(/./mu)} != #{text.size}. #{sms_parts.size} part/s."
sms(recipient, sms_parts, originator, validityperiod)
end
end
+ def get_inbox_messages
+ client = Savon::Client.new(INBOX_SERVICE_WSDL)
+ #http://jira.codehaus.org/browse/JRUBY-5529 - jruby-openssl in --1.9 jruby mode
+ client.http.auth.ssl.verify_mode=(:none)
+ resp = client.request :com, :get_messages do |soap|
+ soap.header["com:MessengerHeader"] = {"com:Username" => @username, "com:Password" => @password, "com:Account" => @account_reference}
+ end
+ resp[:get_messages_response][:get_messages_result][:message]
+ end
+
def get_credit
client = Savon::Client.new(ACCOUNT_SERVICE_WSDL)
#http://jira.codehaus.org/browse/JRUBY-5529 - jruby-openssl in --1.9 jruby mode
client.http.auth.ssl.verify_mode=(:none)
resp = client.request :com, :get_message_limit do |soap|
soap.header["com:MessengerHeader"] = {"com:Username" => @username, "com:Password" => @password, "com:Account" => @account_reference}
end
- resp.to_hash[:get_message_limit_response][:get_message_limit_result].to_i
+ resp.to_hash[:get_message_limit_response][:get_message_limit_result].to_s
end
def get_status(*message_id)
connect unless @client
@@ -69,10 +79,10 @@
message_id.each do |id|
resp = @client.request :com, :get_message_status do |soap|
soap.header["com:MessengerHeader"] = {"com:Username" => @username, "com:Password" => @password, "com:Account" => @account_reference}
soap.body = {"com:id" => id.to_s}
end
- @sent_message_statuses << resp.to_hash[:get_message_status_response][:get_message_status_result]
+ @sent_message_statuses[id] = resp.to_hash[:get_message_status_response][:get_message_status_result]
end
else
resp = @client.request :com, :get_message_status do |soap|
soap.header["com:MessengerHeader"] = {"com:Username" => @username, "com:Password" => @password, "com:Account" => @account_reference}
soap.body = {"com:id" => message_id.first}