Skip to content

Instantly share code, notes, and snippets.

@msdundar msdundar/ttsms.rb
Created Jan 24, 2014

Embed
What would you like to do?
# coding: utf-8
require 'savon'
# Konfigürasyon
client = Savon.client(
wsdl: "http://ws.ttmesaj.com/service1.asmx?WSDL",
soap_version: 2,
)
# Sorgulama Request
message = {
"username" => "*****",
"password" => "*****",
"numbers" => "905544843760",
"message" => "Merhaba! Nasılsın?",
"origin" => "OMU UZEM",
}
response = client.call( :send_single_sms, message: message)
# WSDL üzerindeki servisleri liste
client.operations.each {|operation| p operation }
# Debugging - şartlı yapı kurulacak
puts "\n1)Response Başarılı mı?", response.success?
puts "2)SOAP hatası var mı?", response.soap_fault?
puts "3)HTTP hatası var mı?", response.http_error?, "\n"
puts "Response Header: ", response.header
puts "Response Body: ", response.body, "\n"
@seyyah

This comment has been minimized.

Copy link

commented Jan 24, 2014

Çoklu SMS örneği,

message = {
        "username" => "xxx",
        "password" => "xxx",
        "numbers" => "905x,905x",
        "message" => "Merhaba! Nasılsın?",
        "origin" => "xxx",
       }

nto_nsms: tekrar test edilecek,

message = {
        "username" => "xxx",
        "password" => "xxx",
        "message" => "<SMS><kisi><mesaj>Denem1</mesaj><gsm>905x</gsm></kisi></SMS>",
        "origin" => "xxx",
       }

response = client.call( :send_nto_nsms, message: message) 

Kaynaklar

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
You can’t perform that action at this time.