views:

138

answers:

2

Is it possible to use protobuf-net in RESTful webservices created using WCF RESTful starter kit or OpenRasta? If it possible, are there any examples or code snippets available? I am creating a .NET Web Service which will be consumed by Java client.

+1  A: 

I haven't looked at it /specifically/, but it is potentially something that extra tooling could help with.

If you are working with both java and .NET, then it is a bigger question than just protobuf-net; you'd need to be able to consume it as the java end as well. protobuf (the wire format) is cross-platform, with protobuf-net being just one specific implementation.

If your preferred REST API allows efficient byte[] handling (either as a base-64 string in a message, or as the raw response) you could just treat it as binary.

If you can point me at the tooling you want to use, I can take a look, but I can't guarantee anything immediate.

Marc Gravell
Thanks Marc. In my case, I will have to use protobuf(wire format) or XML for cross platform. I will give a try to byte [] option. But if you can add support for WCF RESTful starter kit in future version of protobuf-net it will be great.
rxm0203
@rxm0203 - I'll certainly look at it. It isn't a tool I've used in the past, but sounds that it may have possibilities. Need to finish "v2" first, though.
Marc Gravell
A: 

There is no out of box support for protocol buffer in OR, but it's a 5 linuers to plug-in a new codec to read and write the format.

serialseb