2013-06-21 2 views
0

deserialize 할 때 http 응답에 두 번 표시되지만 피드와 데이터 멤버를 확인한 후 "재생"이 두 번 반복되지 않습니다.DataContractJsonSerializer repeated member

[System.Runtime.Serialization.SerializationException] = { "데이터 부재가 '재생'입력 번 이상 발견 되었기 때문에 데이터 계약 타입 'PlayerDetailsSeason'는 탈 직렬화 될 수 없습니다."}

내가 http 응답 메시지에서 두 번 표시되는 이유를 모르겠습니다.

여기, 내가 두 번까지 보이고있다 "놀았다"는 일원이 볼 수있는 contentresponsestr 조사에 코드를

  var httpRequest = new HttpRequestMessage(HttpMethod.Get, requestUrl + ConstructRequestContent(requestParams)); 

      var httpClient = new HttpClient(); 
      HttpResponseMessage responseMessage = await httpClient.SendAsync(httpRequest); 
      if (responseMessage != null && responseMessage.IsSuccessStatusCode) { 
       Stream stream = await responseMessage.Content.ReadAsStreamAsync(); 

       DataContractJsonSerializer deserializer = new DataContractJsonSerializer(typeof(T)); 

       string contentresponsestr = await responseMessage.Content.ReadAsStringAsync(); 

//을합니다. 왜 두 번 보여 주나요?

   result = (T)deserializer.ReadObject(stream); 

      } 

      return result; 
     } catch (Exception ex) 
     { 

      return result; 
     } 

답변

0

ok 피드 문제가 발견되었습니다. 이상하게도 크롬과 다른 많은 json 유효성 검사기는 중복 데이터 멤버를 확인하지 않습니다.

관련 문제