(soap:服务器) 服务器无法处理请求。 --->未将字符串引用设置为字符串的实例。参数名称:s
我正在使用 savon 来使用 API。以下是我的代码行。
wSDL = "some_wsdl"
client = Savon::Client.new(wSDL)
response = client.soap_action do |soap|
soap.body = "<sample>string_value</sample>" , "<sample1>string_value</sample1>"
end
我收到错误(标题),下面是应用程序跟踪。 顺便说一句,我的 wsdl 格式为 https://some_wsdl 格式,如果这很重要的话。
/var/lib/gems/1.8/gems/savon-0.7.9/lib/savon/response.rb:141:in `handle_soap_fault' /var/lib/gems/1.8/gems/savon-0.7.9/lib/savon/response.rb:81:in `initialize' /var/lib/gems/1.8/gems/savon-0.7.9/lib/savon/client.rb:95:in `new' /var/lib/gems/1.8/gems/savon-0.7.9/lib/savon/client.rb:95:in `method_missing' app/controllers/deposit_controller.rb:33:in `deposit'
I am using savon to consume an API. Below are lines from my code.
wSDL = "some_wsdl"
client = Savon::Client.new(wSDL)
response = client.soap_action do |soap|
soap.body = "<sample>string_value</sample>" , "<sample1>string_value</sample1>"
end
I am getting an error (title) and below is the application trace.
Btw, my wsdl is in https://some_wsdl format, if that matters.
/var/lib/gems/1.8/gems/savon-0.7.9/lib/savon/response.rb:141:in `handle_soap_fault' /var/lib/gems/1.8/gems/savon-0.7.9/lib/savon/response.rb:81:in `initialize' /var/lib/gems/1.8/gems/savon-0.7.9/lib/savon/client.rb:95:in `new' /var/lib/gems/1.8/gems/savon-0.7.9/lib/savon/client.rb:95:in `method_missing' app/controllers/deposit_controller.rb:33:in `deposit'
如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。
绑定邮箱获取回复消息
由于您还没有绑定你的真实邮箱,如果其他用户或者作者回复了您的评论,将不能在第一时间通知您!
发布评论
评论(1)
不知道为什么你会收到错误,但你通过将肥皂体构建为绳子而让生活变得困难。 Savon 从哈希构建 SOAP 请求,因此以下内容将更轻松地完成您想要的事情
Not sure why you are getting the error but you are making life difficult by building the soap body as a string. Savon build SOAP requests from Hashes so the following will do what you want somewhat more easily