[SoapRMI] Passing byte array using soap
Aleksander Slominski
aslom_at_cs.indiana.edu
Thu, 31 Jan 2002 23:12:47 -0500
Frank Montyne wrote:
> I'm trying to pass arbitrary Java Objects over the wire using SOAP.
> Initially I tried using the Marshal, Unmarshal classes but not all
> objects can be passed. I sometimes get errors on getter/setter functions
> and so on.
> After that I serialized the object into a byte[] using the
> ObjectOutputStream class and I now want to pass this array using SOAP.
> In a first attempt I passed the byte[] as a String (newString(byte[])
> but then sometimes the byte[] I get back on the other side using
> String.getBytes() is not an exact copy.
that can be related to UNICODE String <-> bytes translations can be different on
different sides.
> This seems to be caused if there
> are byte values greater than 127 in the array. Can I pass the byte[]
> directly over SOAP and if so could someone give an example ?
you should be able to pass it as any other type array but byte[] (such as int[]).
it is long time that i wanted to add BASE64 de/serializer for byte[] so i guess i
will do it this weekend :-)
alek