보안 연결이 필요한 모바일 응용 프로그램과 상호 작용할 웹 서비스를 작성하려고합니다.JsonResult 안전한 연결로 왜곡 됨
보안되지 않은 연결을 통해 서버에서 원하는 JSON Result를 얻고 테스트 장치에서 해당 JSON 객체를 빌드 할 수 있습니다.
목적 JSON 결과이다 : 그러나
{"memberID":"999999","statusCode":"0","message":"Your member information has been processed, please confirm to continue with payment.","total":"66.66"}
보안 연결 제어기 복귀하여 :
ur member information has been processed, please confirm to continue with payment.","total":"66.66"}
서버 측 코드는 지금 간단
[HttpPost]
public JsonResult startTransaction(FormCollection form) {
// process form values
Dictionary<string,string> result = new dictionary<string,string>();
result.Add("memberID","999999");
result.Add("statucCode","0");
result.Add("message","Your member information has been processed, please confirm to continue with payment.");
result.Add("total","66.66");
return Json(result);
}
을
개발을 위해 기기 측 (Android)에서 도움을 받으려면에 대한 모든 인증서를 수락합니다..
응답이 이렇게 줄어들지 모르겠습니다.
는 UPDATE :
Fiddler2, 방화범, 및 JSONView 시도 후, 나는 여전히 오류를 해결할 수없는 것.
responseStream = connection.getInputStream();
int bytesRead = -1;
byte[] buffer = new byte[8*1024];
while((bytesRead = responseStream.read(buffer)) >= 0) {}
response = new String(buffer);
내가 버퍼가 너무 작았 생각했지만 큰 버퍼 사이즈를 시도한 이후 즉, 그렇지 않은 : 응답이 판독
(안드로이드 기기) 코드이다.
HTTPS 요청을 수행하고 결과를 확인하려면 Fiddler 또는 Firebug를 사용합니다. 무엇을 하는가? – ollifant