views:

221

answers:

1

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

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.

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

Thanks,
Alex

+1  A: 

found two discussions in the soap4r google group:

"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. second link added as a comment.
i'm not allowed to post more than one link in an answer due to spam protection

rubiii
rubiii
there's also a pastie that might help: http://pastie.org/233020
rubiii
Thanks, this was more information than I could find on the subject. I should turn in my google/bing license. :)
Alex Moore
your welcome. glad these information helped you out.
rubiii