public static Dictionary <string, string> ContentToEventParamsForWebRio(WebRioResponse ssoResult) { var eventParams = new Dictionary <string, string>(); eventParams.Add("responseCode", ssoResult.ResponseCode); eventParams.Add("responseMessage", ssoResult.ResponseMessage); eventParams.Add("webRioUrl", ssoResult.WebRioUrl); return(eventParams); }
private Dictionary <string, string> GetEventParameters(WebRioResponse webRioResponse, ResponseEntity response) { if (response == null) { throw new ArgumentNullException("response"); } var eventParameters = WebServiceExchangeHelper.ContentToEventParamsForWebRio(webRioResponse); if (eventParameters == null || eventParameters.Count == 0) { return(null); } string jsessionId = string.Empty; if (response.Cookies != null && response.Cookies.TryGetValue(ResponseAttribute.WebRioResponseCookie_JSessionId, out jsessionId)) { eventParameters.Add(ResponseAttribute.WebRioResponseCookie_JSessionId, jsessionId); } return(eventParameters); }
public static WebRioResponse DeserializeWebRioSsoResponseJson(string json) { try { if (string.IsNullOrWhiteSpace(json)) { return(null); } var response = new WebRioResponse(); using (var memoryStream = new MemoryStream(Encoding.UTF8.GetBytes(json))) { var deSerializer = new DataContractJsonSerializer(response.GetType()); response = deSerializer.ReadObject(memoryStream) as WebRioResponse; } return(response); } catch { return(null); } }