我有一个图像对象,需要保存在服务器上。我将其转换为字节数组,然后使用可选数据将其序列化为JSON。但是服务器无法成功转换它,并且向我返回了一条错误消息:
{
"Message": "Cannot convert object of type 'System.String' to type 'System.Byte[]'",
"StackTrace": " at System.Web.Script.Serialization.ObjectConverter.ConvertObjectToTypeInternal(Object o, Type type, JavaScriptSerializer serializer, Boolean throwOnError, Object& convertedObject) at System.Web.Script.Serialization.ObjectConverter.AssignToPropertyOrField(Object propertyValue, Object o, String memberName, JavaScriptSerializer serializer, Boolean throwOnError) at System.Web.Script.Serialization.ObjectConverter.ConvertDictionaryToObject(IDictionary`2 dictionary, Type type, JavaScriptSerializer serializer, Boolean throwOnError, Object& convertedObject) at System.Web.Script.Serialization.ObjectConverter.ConvertObjectToTypeInternal(Object o, Type type, JavaScriptSerializer serializer, Boolean throwOnError, Object& convertedObject) at System.Web.Script.Services.WebServiceMethodData.StrongTypeParameters(IDictionary`2 rawParams) at System.Web.Script.Services.RestHandler.InvokeMethod(HttpContext context, WebServiceMethodData methodData, IDictionary`2 rawParams) at System.Web.Script.Services.RestHandler.ExecuteWebServiceCall(HttpContext context, WebServiceMethodData methodData)",
"ExceptionType": "System.InvalidOperationException"
}
我发送的我的Json数据:
{
"articleData": {
"ArticleNumber": "002",
"ArticlePhoto": "/9j/4QBwRXhpZgAATU0AKgAAAAgABIdpAAQAAAABAAAAPgESAAQAAAABAAAAAAEAAAQAAAABAAAC0AEBAAQAAAABAAAFAAAAAAAAA6ACAAMAAAABAWgAAKADAAMAAAABAoAAAJIIAAQAAAABAAAAAAAAAAD/4AAQSkZJRgABAQAAAQABAAD/2wBDABQODxIPDRQSEBIXFRQYHjIhHhwcHj0sLiQySUBMS0dARkVQWnNiUFVtVkVGZIhlbXd7gYKBTmCNl4x9lnN+gXz/2wBDARUXFx4aHjshITt8U0ZTfHx8fHx8fHx8fHx8fHx8fHx8fHx8fHx8fHx8fHx8fHx8fHx8fHx8fHx8fHx8fHx8fHz/wAARCAKAAWgDASIAAhEBAxEB/8QAHwAAAQUBAQEBAQEAAAAAAAAAAAECAwQFBgcICQoL/8QAtRAAAgEDAwIEAwUFBAQAAAF9AQIDAAQRBRIhMUEGE1FhByJxFDKBkaEII0KxwRVS0fAkM2JyggkKFhcYGRolJicoKSo0NTY3ODk6Q0RFRkdISUpTVFVWV1hZWmNkZWZnaGlqc3R1dnd4eXqDhIWGh4iJipKTlJWWl5iZmqKjpKWmp6ipqrKztLW2t7i5usLDxMXGx8jJytLT1NXW19jZ2uHi4+Tl5ufo6erx8vP09fb3+Pn6/8QAHwEAAwEBAQEBAQEBAQAAAAAAAAECAwQFBgcICQoL/8QAtREAAgECBAQDBAcFBAQAAQJ3AAECAxEEBSExBhJBUQdhcRMiMoEIFEKRobHBCSMzUvAVYnLRChYkNOEl8RcYGRomJygpKjU2Nzg5OkNERUZHSElKU1RVVldYWVpjZGVmZ2hpanN0dXZ3eHl6goOEhYaHiImKkpOUlZaXmJmaoqOkpaanqKmqsrO0tba3uLm6wsPExcbHyMnK0tPU1dbX2Nna4uPk5ebn6Onq8vP09fb3+Pn6/9oADAMBAAIRAxEAPwDjKKKKACiiigAooooAKKKKACiiigAooooAKKKKACiiigAooooAKKKKACiiigAooooAKKKKACiiigAooooAKKKKACiiigAooooAKKKKACiiigAooooAKKKKACiiigAoqWigCKipaKAIqKlooAioqWigCKipaKAIqKlooAioqWigCKipaKAIqKlooAioqWigCKipaKAIqKlooAioqWigCKipaKAIqKlooAioqWigCKipaKAIqKlooAioqWigCKipaKAIqKlooAioqWigCKipaKACiiigAooooAKKKKACiiigAooooAKKKKACiiigAooooAKKKKACiiigAooooAKKKKACiiigAooooAKKKKACiiigAooooAKKKKACiiigAooooAKKKKACiiigAooooAKKKKACiiigAooooAKKKKACiiigAooooAKKKKACiiigAooooAKKKKACiiigAooooAKKKKACiiigAooooAKKKKACiiigAooooAKKKKACiiigAooooAKKKKACiiigAooooAKKKKACiiigAooooAKKKKACiiigAooooAKKKKACiiigAooooAKKKKACiiigAooooAKKKKACiiigAooooAKKKKACiiigAooooAKKKKACiiigAooooAKKKKACiiigAooooAKKKKACiiigAooooAKKKKACiiigAooooAKKKKACiiigAooooAKKKKACiiigAooooAKKKKACiiigAooooAKKKKACiiigAooooAKKKKACiiigAooooAKKKKACiiigAooooAKKKKACiiigAooooAKKKKACiiigAooooAKKKKACiiigAooooAKKKKACiiigAooooAKKKKACiiigAooooAKKKKACiiigAooooAKKKKACiiigAooooAKKKKACiiigAooooAKKKKACiiigAooooAKKKKACiiigAooooAKKKKACiiigAooooAKKKKACiiigAooooAKKKKACiiigAooooAKKKKACiiigAooooAKKKKACiiigAooooAKKKKACiiigAooooAKKKKACiiigAooooAKKKKACiiigAooooAKKKKACiiigAooooAKKKKACiiigAooooAKKKKACiiigAooooAKKKKACiiigAooooAKKKKACiiigAooooAKKKKACiiigAooooAKKKKACiiigAooooAKKKKACiiigAooooAKKKKACiiigAooooAKKKKACiiigAooooAKKKKACiiigAooooAKKKKACiiigAooooAKKKKACiiigAooooAKKKKACiiigAooooAKKKKACiiigAooooAKKKKACiiigAooooAKKKKACiiigAooooAKKKKACiiigAooooAKKKKACiiigAooooAKKKKACiiigAooooAKKKKACiiigAooooAKKKKACiiigAooooAKKKKACiiigAooooAKKKKACiiigAooooAKKKKACiiigAooooAKKKKACiiigAooooAKKKKACiiigAooooAKKKKACiiigAooooAKKKKACiiigAooooAKKKKACiiigAooooAKKKKACiiigAooooAKKKKACiiigAooooAKKKKACiiigAooooAKKKKACiiigAooooAKKKKACiiigAooooAKKKKACiiigAooooAKKKKACiiigAooooAKKKKACiiigAooooAKKKKACiiigAooooAKKKKACiiigAooooAKKKKACiiigAooooAKKKKACiiigAooooAKKKKAND7HF/tfnS/Yov9r86npcVndjIBZQ/wC1+dKLGI/3vzqcVIBxRdgVfsEOP4vzo+wQ/wC1+dWiOKXFF2BT+wQ/7X50v2CH/a/OrYFLii7AqjToD/e/OnjTbfH8X51YWnr0ouwKy6Xbnrv/AO+q6KDwjpkkCORNllBPz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bRTth9aNh9aAG0U7Z70bPegBtFO2H1o2e9ADaKdso8s+tADaBTtnvRs96AEzQAT0p4QDrzThQA0J604DFFFABRS0ooAbinAU5R7VKoHoKQEQFKBTnxu44oAoAULTgOKaF96eBSGKKUCkApRQAtOFIAacBSGApw600Cnge9ADlpw60iilI4zQAtLQKAKAFooApcUAQlj5mKsIelV3xuzUsZ6VDGi0nSs+4/4/Y/8Aeq+n3az7j/j8T60LcaLlNpufc0cVZAtFBUGimBz+/wBqN/tTKKsQ/f7Ub/amUUAP3+1G/wBqZRQA/f7Ub/amUUAP3+1G/wBqZRQA/wAz2o8z2plFAD9/tR5h9KZRQA/zPajzPamUUAP3+1Hme1MooAk8z2FHm+1R0UWAlE5HYU77Sf7o/OoKKVgJvPJOdopRckfwioKKLAWPtR/uj86PtR/uj86r0UWAs/az/dH50C8YfwD86rUUWQFr7af7g/Ol+2t/cH51UoosgLYvm/uD86UX7D/lmPzqnRRZDuy8NRYf8sx+dL/aTYx5Y/OqFFFkFy9/aTf88x+dKNTb/nmPzqhRRZCND+1G/wCeS/nR/aj/APPMfnWfRRZAXTqDE/6sfnSrqTL/AMsx+dUaKOVDuaS6w6jHlL+dQyX7SSh9gBHvVOilyoLsvDUn/uD86P7Tf/nmPzqjRTshF8ao4/5Zj86KoUUWQBRRRTAKKKKACiiigAooooAKKKKACiiigAooooAKKKKACiiigAooooAKKKKACiiigAooooAKKKKACiiigAooooAKKKKACiiigAooooAKKKKACiiigAooooAKKKKACiiigAooooAKKKKACiiigAooooAKKKKACiiigAooooAKKKKACiiigAooooAKKKKACiiigAooooAKKKKACiiigAooooAKKKKACiiigAooooAKKKKACiiigAooooAKKKKACiiigAooooAKKKKACiiigAooooAKKKKACiiigAooooAKKKKACiiigAooooAKKKKACiiigAooooAKKKKACiiigAooooAKKKKACiiigAooooAKKKKACiiigAooooAKKKKACiiigAooooAKKKKACiiigAooooAKKKKACiiigAooooAKKKKACiiigAooooAKKKKACiiigAooooAKKKKACiiigAooooAKKKKACiiigAooooAKKKKACiiigAooooAKKKKACiiigAooooAKKKKACiiigAooooAKKKKACiiigAooooAKKKKACiiigAooooAKKKKACiiigAooooAKKKKACiiigAooooAKKKKACiiigAooooAKKKKACiiigAooooAKKKKACiiigAooooAKKKKACiiigAooooAKKKKACiiigAooooAKKKKACiiigAooooAKKKKACiiigAooooAKKKKACiiigAooooAKKKKACiiigAooooAKKKKACiiigAooooAKKKKACiiigAooooAKKKKACiiigAooooAKKKKACiiigAooooAKKKKACiiigAooooAKKKKACiiigAooooAKKKKACiiigAooooAKKKKACiiigAooooAKKKKACiiigAooooAKKKKACiiigAooooAKKKKACiiigAooooAKKKKACiiigAooooAKKKKACiiigAooooAKKKKACiiigAooooAKKKKACiiigAooooAKKKKACiiigAooooAKKKKACiiigAooooAKKKKACiiigAooooAKKKKACiiigAooooAKKKKACiiigAooooAKKKKACiiigAooooAKKKKACiiigAooooAKKKKACiiigAooooAKKKKACiiigAooooAKKKKACiiigAooooAKKKKACiiigAooooAKKKKACiiigAooooAKKKKACiiigAooooAKKKKACiiigAooooAKKKKACiiigAooooAKKKKAP//Z"
},
"sessionId": "d98b2c41-373a-40af-ac3b-874198e22a08"
}
我的请求提供者:
public class JsonProvider : IJsonProvider
{
private const string JsonContentType = "application/json";
public async Task<TResult> MakeApiCall<TResult,TData>(string url, HttpMethod method, TData data)
where TResult : class
{
using (var httpClient = new HttpClient())
{
using (var request = new HttpRequestMessage(method, url))
{
if (method != HttpMethod.Get)
{
var json = await Task.Run(() => JsonConvert.SerializeObject(data))
.ConfigureAwait(false);
request.Content = new StringContent(json, Encoding.UTF8, JsonContentType);
}
HttpResponseMessage response = await httpClient.SendAsync(request)
.ConfigureAwait(false);
var stringSerialized = await response.Content.ReadAsStringAsync()
.ConfigureAwait(false);
return await Task.Run(() => JsonConvert.DeserializeObject<TResult>(serialize))
.ConfigureAwait(false);
}
}
}
}
请求对象:
public class SessionRequest
{
[JsonProperty("sessionId")] public string SessionId { get; set; }
}
public class UploadArticlePhotoRequest : SessionRequest
{
[JsonProperty("articleData")] public PhotoRequest ArticleData { get; set; }
}
public class PhotoRequest
{
[JsonProperty("ArticleNumber")] public string ArticleNumber { get; set; }
[JsonProperty("ArticlePhoto")] public byte[] ArticlePhoto { get; set; }
}
可以转换或编码格式出现问题吗?是客户端应用程序还是服务器问题?