Java中的DatacontractSerializer [英] DatacontractSerializer in Java
问题描述
Java中是否存在可以反序列化由DataContractSerializer序列化的.net对象的方法或库?
Is there a method or library in Java which can deserialize a .net object which was serialized by DataContractSerializer?
我的情况:
我想创建一个Java客户端,该客户端可以通过http与Microsoft MQ(MSMQ)进行通信.我想使用.Net中的DataContractSerializer和Java中的序列化器,以便.Net可以读取由Java序列化的消息的内容.
I want to create a java-client which can communicate with Microsoft MQ (MSMQ) over http. I want to use the DataContractSerializer in .Net and an Serializer in Java so that .Net can read the content of the message which is serialized by java.
推荐答案
我的解决方案是使用jackson json序列化程序.另外,我使用Bson4jackson库来序列化字节数组.这对我来说是一个快速的解决方案.
My solution was to use the jackson json serializer. Additionally i use the Bson4jackson library to serialize byte arrays. This is a fast solution for me.
在.net端,我使用带有BsonWriter/Reader的NewtonSoft Json序列化器(也进行反序列化)来接收和发送消息.
On the .net side i use the NewtonSoft Json serializer (deserializes too) with BsonWriter/Reader to receive and send messages.
这篇关于Java中的DatacontractSerializer的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!