Soap Savon HTTP::错误,但没有更多信息?
我正在尝试使用以下代码将rails应用程序配置为与soap Web服务对话:Soap Savon HTTP::错误,但没有更多信息?,soap,ruby-on-rails-3.1,savon,Soap,Ruby On Rails 3.1,Savon,我正在尝试使用以下代码将rails应用程序配置为与soap Web服务对话: client = Savon::Client.new do wsdl.document = "http://services.carsolize.com/BookingServices/dynamicdataservice.svc?wsdl" end response = client.request "ServiceRequest", "xmlns" => "http://tempuri.org/" do
client = Savon::Client.new do
wsdl.document = "http://services.carsolize.com/BookingServices/dynamicdataservice.svc?wsdl"
end
response = client.request "ServiceRequest", "xmlns" => "http://tempuri.org/" do |soap, wsdl|
client.http.headers["SOAPAction"] = '"http://tempuri.org/IDynamicDataService/ServiceRequest"'
soap.body = {
"rqst" => {
"Credentials" => {
"UserName" => 'user',
"Password" => 'pass'
},
"RequestType" => "Login",
"TypeOfService" => "Unknown",
},
}
end
但我得到的只是以response开头的行的HomeController索引中的Savon::HTTP::Error(没有更多信息)
client = Savon.client 'http://services.carsolize.com/BookingServices/dynamicdataservice.svc?wsdl'
username = '*********'
password = '*********'
response = client.request :wsdl, :login do
http.headers["SOAPAction"] = '"http://tempuri.org/IDynamicDataService/ServiceRequest"'
soap.xml = "<s:Envelope xmlns:s='http://schemas.xmlsoap.org/soap/envelope/'><s:Body><ServiceRequest xmlns='http://tempuri.org/'><rqst xmlns:i='http://www.w3.org/2001/XMLSchema-instance'><Credentials xmlns=''>
<Password>#{password}</Password><UserName>#{username}</UserName></Credentials><RequestType xmlns=''>Login</RequestType><TypeOfService xmlns=''>Unknown</TypeOfService></rqst></ServiceRequest></s:Body></s:Envelope>"
end
client=Savon.client'http://services.carsolize.com/BookingServices/dynamicdataservice.svc?wsdl'
用户名='********'
密码='********'
response=client.request:wsdl,:login-do
http.headers[“SOAPAction”]='”http://tempuri.org/IDynamicDataService/ServiceRequest"'
soap.xml=”
#{密码}{用户名}登录未知“
结束
而且效果很好为什么单引号中有双引号?是否要将引号作为该字符串的一部分?