Reputation: 9019
Can you pass around protobuf messages server side and get ServiceStack to translate it to JSON for JavaScript and keep it as protobuf for non-JavaScript clients?
Upvotes: 1
Views: 197
Reputation: 143374
ServiceStack supports having the same service being called via ProtoBuf and JSON endpoints, yes.
But there's no magic translation between ProtoBuf and JSON wire formats, your service simply returns JSON when called by a JSON ServiceClient or HTTP Client (e.g. jQuery), likewise it will return the Protocol Buffers format when called by the ProtoBufServiceClient.
Upvotes: 2