private void OnGetProfile(DataModels.Profile resp, string data) { if (m_Callback != null) { m_Callback(SERVICE_ID, resp != null); } }
private void GetProfileResponse(RESTConnector.Request req, RESTConnector.Response resp) { DataModels.Profile response = new DataModels.Profile(); if (resp.Success) { try { fsData data = null; fsResult r = fsJsonParser.Parse(Encoding.UTF8.GetString(resp.Data), out data); if (!r.Succeeded) { throw new WatsonException(r.FormattedMessages); } object obj = response; r = sm_Serializer.TryDeserialize(data, obj.GetType(), ref obj); if (!r.Succeeded) { throw new WatsonException(r.FormattedMessages); } } catch (Exception e) { Log.Error("PersonalityInsights", "GetProfileResponse Exception: {0}", e.ToString()); resp.Success = false; } } if (((GetProfileRequest)req).Callback != null) { ((GetProfileRequest)req).Callback(resp.Success ? response : null, ((GetProfileRequest)req).Data); } }