activemq-dev mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From Adam Kaminiecki <ada...@dgt.com.pl>
Subject Re: sending ObjectMessage between C# and Java
Date Wed, 16 Feb 2011 14:27:42 GMT
Hi.

You are right. After investigation a can tell you now and Im SURE Its 
impossible to send ObjectMessage between clients (C# is not able to get 
body from this type of message in Java it is possible after workaround 
:) ). Only solution is serialize object to XML and then send it as 
TextMessage. Thats work fine!


Regards,
Adam



W dniu 2011-02-16 12:49, Timothy Bish pisze:
> On Wed, 2011-02-16 at 11:31 +0100, Adam Kaminiecki wrote:
>> Hi,
>>
>> Can anybody tell me how to get body form ObjectMessage in C#  or
>> properly send from Java??
>> Everything work ok for TextMessage but when I send  text message from
>> Java in ObectMessage in C# client occur an error
>>
>> where IMessage m
>> ((IObjectMessage) m).Body = '((IObjectMessage) m).Body' threw an
>> exception of type 'System.Runtime.Serialization.SerializationException'
>>
>> System.SystemException {base} = {"input stream is not a valid binary
>> format. The content of the initial (in bytes):.......
>>
>>
>> But when I send From C# it is ok.
>>
> C# cannot de-serialize a java Object, it doesn't know anything about the
> byte java types or how they are encoded.  You can send C# objects to C#
> clients if they know about the type you are sending but that's the limit
> of what you can do with ObjectMessage in C#.
>
> If you really need to send objects then you should look into using
> something like XStream to convert them to XML and then parse the XML on
> the C# side.
>
> Regards
>

-- 
This message has been scanned for viruses and
dangerous content by MailScanner, and is
believed to be clean.


Mime
View raw message