From: Khudadad Kazi Date: 2013-05-31T00:45:21+09:00 Subject: Re: Converting an xml file to byte array in ruby I have now tried various combinations. After I call the web services method, I have a tool to go and check if the file was attached or not.And none of the methods seem to work. I have attached a whole stack trace for your reference. Here is a summary of the various ways I have tried : Step 1. Read the xml file xmlfeed = Nokogiri::XML(open("D:\FSII AudioCo.NewMediaPlayerOffersVideo.xml")) Step 2. convert to Base64binary and call (Please refer my previous post to see the method that I am calling) trial 1. fileData=Base64.encode64(xmlfeed) Result: SOAP response (status 200) with a "=>nil" at the end. trial 2. fileData=xmlfeed.to_s converting to string as it is. Result: Savon::HTTPError: HTTP error (400): Bad Request trial 3. fileData=Base64.encode64(xmlfeed.to_s) Result: SOAP response (status 200) with a "=>nil" at the end. Kindly point out what is wrong.(or the things are going wrong in my head ?) Kind regards, Kazi Attachments: http://www.ruby-forum.com/attachment/8464/B64b.txt -- Posted via http://www.ruby-forum.com/.