我正在使用YieldManager Rightmedia,API使用SOAP over HTTP与客户端交换请求和响应。如何使用ruby构建Web服务客户端请求。
更新
I follow as per the Yieldmanager docs.., I added the following
require "soap/wsdlDriver"
(soap_base, username, password) = ARGV
contact_client = SOAP::WSDLDriverFactory.new(soap_base + 'contact.php?wsdl').create_rpc_driver
contact_client.wiredump_dev = STDOUT;
token = contact_client.login(username, password, nil)
当我尝试这样做时,我收到连接拒绝错误,如YieldManager: Connection refused - connect(2) (://:0)
先谢谢
答案 0 :(得分:0)
您可以使用savon库。
您可以使用以下命令安装它:
gem install savon --version '~> 2.0'
然后你创建客户端:
client = Savon.client(wsdl: "http://example.com?wsdl")
然后你发送请求:
response = client.call(:authenticate, message: { username: "luke", password: "secret" })
此处有更多信息:http://savonrb.com/version2