ruby invoke webservices with savon

require 'rubygems'
require 'bundler'
Bundler.setup(:default)

require "savon"
require "pry"

client = Savon.client(
  :wsdl => "http://ws.cdyne.com/emailverify/Emailvernotestemail.asmx?wsdl",
  :open_timeout => 10,
  :read_timeout => 10,
  :log => false
)

response = client.call(:verify_email, :message => { :email => "[email protected]", "LicenseKey" => "?" })
response_text = response.body[:verify_email_response][:verify_email_result][:response_text]
p response_text


=begin
➜  use_savon  ruby main.rb
"Email Domain Not Found"
➜  use_savon  ruby main.rb
"User Not Found"
➜  use_savon  ruby main.rb
"Mail Server will accept email"
=end

你可能感兴趣的:(ruby invoke webservices with savon)