From: Robert Klemme Date: 2013-05-28T00:36:07+09:00 Subject: Re: Converting an xml file to byte array in ruby --089e0149ccde30997904ddb4e80a Content-Type: text/plain; charset=ISO-8859-1 On Mon, May 27, 2013 at 5:22 PM, Khudadad Kazi wrote: > Can someone help me with converting an xml file to byte array in ruby ? > I have a requirement to send a file as a byte array to a SOAP based web > service. > That sounds so wrong. I mean, you have XML and a protocol which uses XML messages - and it's especially tailored to allow for embedding arbitrary XML content in the message body. Why send as a "byte array"? What is this supposed to mean anyway? > I have created ruby methods to do some other functions which deal with > strings and arrays. But I am unable to convert file to byte array to use > it with a particular method. > The thing which comes closes to a "byte array" in Ruby is a String with encoding "BINARY". Cheers robert -- remember.guy do |as, often| as.you_can - without end http://blog.rubybestpractices.com/ --089e0149ccde30997904ddb4e80a Content-Type: text/html; charset=ISO-8859-1 Content-Transfer-Encoding: quoted-printable



On Mon, May 27, 2013 at 5:22 PM, Khudadad Kazi &l= t;lists@ruby-foru= m.com> wrote:
Can someone help me with converting an xml f= ile to byte array in ruby ?
I have a requirement to send a file as a byte array to a SOAP based web
service.

That sounds so wrong. = =A0I mean, you have XML and a protocol which uses XML messages - and it'= ;s especially tailored to allow for embedding arbitrary XML content in the = message body. =A0Why send as a "byte array"? =A0What is this supp= osed to mean anyway?
=A0
I have created ruby methods to= do some other functions which deal with
strings and arrays. But I am unable to convert file to byte array to use it with a particular method.

The = thing which comes closes to a "byte array" in Ruby is a String wi= th encoding "BINARY".

Cheers=

robert

--
remember.guy do |as, often| as.you_can - without end
http://blog.rubybestpractices.co= m/
--089e0149ccde30997904ddb4e80a--