Thanks Nadav..! Perfect.!  This is what causing the problem.   In Json,
value will be always passed as hexString like 12340000.  Do I need to
change the json value to base64 encoded string as intermediate layer and
then use the Google parser?  What will be your suggestion. ?

Thanks Nadav

On Fri, 6 Sep 2019 at 20:48, Nadav Samet <[email protected]> wrote:

> Note that the JSON protobuf format represents bytes as base64 string:
> https://developers.google.com/protocol-buffers/docs/proto3#json
> I think you assume the bytes are going to be represented as an hexstring
> in the json, given your earlier question
> <https://groups.google.com/forum/#!topic/protobuf/qugKZT26aLg>.
>
> -Nadav
>
> On Thursday, September 5, 2019 at 11:45:15 PM UTC-7, arun kumar wrote:
>>
>> I have JSON data like below,
>>
>> {
>>   "clientIdentifier": {
>>     "context": "CFID",
>>     "value": "12340000"
>>   },
>>   "desiredSessionTimeout": "30000"
>> }
>>
>> Value 12340000 is the datatype of  " ByteString " as per proto
>>
>> When I am trying to parse using JSON parser
>>
>> Google.Protobuf.JsonParser parser = Google.Protobuf.JsonParser.Default;
>> IMessage imesg= parser.Parse(json, MessageDescriptor);
>>
>> imesg is getting created but the value is being return as 12340000.
>> Because of this , serialized data is showing wrong value.  I tried
>> JSONParser settings as well. But I couldnt get the desired result..
>>
>> I got struck at this point. Please help me out
>>
>> Thanks in Advance,
>> Arun
>>
> --
> You received this message because you are subscribed to the Google Groups
> "Protocol Buffers" group.
> To unsubscribe from this group and stop receiving emails from it, send an
> email to [email protected].
> To view this discussion on the web visit
> https://groups.google.com/d/msgid/protobuf/37f435a7-3650-419e-8deb-0478f4f11c69%40googlegroups.com
> <https://groups.google.com/d/msgid/protobuf/37f435a7-3650-419e-8deb-0478f4f11c69%40googlegroups.com?utm_medium=email&utm_source=footer>
> .
>


-- 
-- Arun

-- 
You received this message because you are subscribed to the Google Groups 
"Protocol Buffers" group.
To unsubscribe from this group and stop receiving emails from it, send an email 
to [email protected].
To view this discussion on the web visit 
https://groups.google.com/d/msgid/protobuf/CAG5mLyst5wSrzqNW0U0UT7Oyipb9SnP7%2BCZrEZ4Dw%2BcBnZbitA%40mail.gmail.com.

Reply via email to