private AcsError readError(HttpResponse httpResponse, FormatType format) { String responseEndpoint = "Error"; IReader reader = ReaderFactory.CreateInstance(format); UnmarshallerContext context = new UnmarshallerContext(); String stringContent = getResponseContent(httpResponse); context.ResponseDictionary = reader.Read(stringContent, responseEndpoint); return(AcsErrorUnmarshaller.Unmarshall(context)); }
private AcsError ReadError <T>(AcsRequest <T> request, HttpResponse httpResponse, FormatType?format) where T : AcsResponse { string responseEndpoint = "Error"; IReader reader = ReaderFactory.CreateInstance(format); UnmarshallerContext context = new UnmarshallerContext(); string body = System.Text.Encoding.Default.GetString(httpResponse.Content); if (null == reader) { context.ResponseDictionary = new Dictionary <string, string>(); } else { context.ResponseDictionary = reader.Read(body, responseEndpoint); } return(AcsErrorUnmarshaller.Unmarshall(context)); }