문제

I'm trying to pass byte array in json via web service. When i try to Deserialize the JSON the byte array value changed to unknow value.

For an example. My byte value when i try to pass to webservice using android.
Code

JSONObject object = new JSONObject();
try {
object.put("WayBillNo", bill);
object.put("ReceiverSignature", image);
} catch (JSONException e) {
e.printStackTrace();
}

Image image

WebService when trying to serialize the JSON. (C#)

Code

payloadObj = JsonConvert.DeserializeObject<T>( encryptedJson );

Image image2

Receiversingnature value change in web service.Any advice/help is appreciated.

도움이 되었습니까?

해결책

I use Base64 which converts binary data to a string.

byte [] image = array;
String stringToStore = new String(Base64.encode(image));
라이센스 : CC-BY-SA ~와 함께 속성
제휴하지 않습니다 StackOverflow
scroll top