如何使用Ruby的SOAP :: Attachment类? [英] How do I use Ruby's SOAP::Attachment class?

查看:72
本文介绍了如何使用Ruby的SOAP :: Attachment类?的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

因此,我正在为SOAP Web服务编写一个Ruby客户端,并且已经弄清楚了如何调用一个简单的方法:

So I'm writing a Ruby client for a SOAP web service, and I've figured out how to call a simple method:

# WebServiceClient.rb
require 'soap/wsdlDriver'

wsdl_url  = 'http://urlmadness?wsdl'
service = SOAP::WSDLDriverFactory.new(wsdl_url).create_rpc_driver
result = service.simpleMethod(:sayHello => 'Hello')

p result.return

现在,我需要编写一些东西来调用一个Web方法,该方法希望将一个附件作为SOAP MIME附件(SwA).我已经研究了Ruby的SOAP::Attachment类,但似乎无法弄清楚如何使用它,而且在任何地方都找不到任何示例.

Now I need to write something that will call a web method that is expecting an attached file as a SOAP MIME Attachment (SwA). I've looked into Ruby's SOAP::Attachment class but I can't seem to figure out how to use it, and I can't find any examples anywhere.

有人知道如何使用它向方法调用中添加MIME附件吗?

Does anybody know how to use it to add a MIME attachment to a method call?

谢谢,
亚历克斯

Thanks,
Alex

推荐答案

在soap4r Google组中找到了两个讨论:

found two discussions in the soap4r google group:

如何添加附件到doc/lit soap请求?"
http://groups. google.com/group/soap4r/browse_frm/thread/1cfc1f87c5cbdda7/a8f58915d4a2de87?lnk=gst&q=attachment#a8f58915d4a2de87

"How to add attachment to doc/lit soap request?"
http://groups.google.com/group/soap4r/browse_frm/thread/1cfc1f87c5cbdda7/a8f58915d4a2de87?lnk=gst&q=attachment#a8f58915d4a2de87

ps.第二个链接已添加为评论.
由于垃圾邮件的保护,我不允许在一个答案中发布多个链接

ps. second link added as a comment.
i'm not allowed to post more than one link in an answer due to spam protection

这篇关于如何使用Ruby的SOAP :: Attachment类?的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆