public List <Eval> GetEvals() { //List<EvalDTO> evals = _repository.GetEvals(); List <Eval> transformedEvals = new List <Eval>(); var s = new Eval() { Comments = "comment", Id = "1", Submitter = "Dijana", TimeSubmitted = DateTime.Now }; transformedEvals.Add(s); return(transformedEvals); }
public void SubmitEvals(Eval eval) { if (eval.Submitter.Equals("throw1")) { throw new Exception("Something Bad Happened"); } else if (eval.Submitter.Equals("throw2")) { throw new FaultException("Something Bad Happened", FaultCode.CreateSenderFaultCode("Bad Submitter Name", "http://learningwcf.com/faultexception")); } else if (eval.Submitter.Equals("throw3")) { throw new FaultException <BadEvalSubmission>(new BadEvalSubmission()); } evalList.Add(eval); Console.WriteLine($" Service received from : {eval.Submitter} at {eval.Timespent}"); }
//[PrincipalPermission(SecurityAction.Demand, Role ="BLRIDCLTP16577\\EvalUser")] //[OperationBehavior(Impersonation =ImpersonationOption.Required)] public void SubmitEvals(Eval eval) { Console.WriteLine($"Caller Identity {ServiceSecurityContext.Current.PrimaryIdentity.Name}"); Console.WriteLine($" Service received from : {eval.Submitter} at {eval.Timespent}"); //code commented for serviceauthorization behavior //if (!this.AuthorizeCaller()) //{ // throw new FaultException("Access Denied......didnot provide the correct claim set"); //} //to demo impersonation and claim based authorization using (FileStream fs = new FileStream(string.Format("{0}.xml", Guid.NewGuid().ToString()), FileMode.Create, FileAccess.Write)) { DataContractSerializer dcs = new DataContractSerializer(typeof(Eval)); dcs.WriteObject(fs, eval); } eval.evalid = (+evalCount).ToString(); evalList.Add(eval); }
public string SubmitEval(Eval eval) { eval.Id = (++evalCount).ToString(); evals.Add(eval); var cctx = WebOperationContext.Current; //return "Service : \n" + // "Incoming request verb is " + WebOperationContext.Current.IncomingRequest.Method + // " , Outgoing responce status is " + cctx.OutgoingResponse.StatusCode.ToString(); System.Reflection.MemberInfo info = typeof(EvalService); foreach (PrintRequestResponseAttribute attrib in info.GetCustomAttributes(true)) { return(attrib.test); } return(""); }
public void SubmitEval(Eval eval) { eval.Id = Guid.NewGuid().ToString(); evals.Add(eval); }
public void SubmitEval(Eval eval) { eval.Id = EvalCount.ToString(); EvalCount++; Evals.Add(eval); }
public void SubmitEvals(Eval eval) { evalList.Add(eval); Console.WriteLine($" Service received from : {eval.Submitter} at {eval.Timespent}"); }
public void SubmitEval(Eval eval) { //if (eval.Submitter.Equals("Throw")) // throw new FaultException("Error within SubmitEval"); evals.Add(eval); }
public void SubmitEval(Eval eval) { eval.Id = (++evalCount).ToString(); evals.Add(eval); }
public void SubmitEval(Eval eval) { evals.Add(eval); }
public Eval SubmitEval(Eval eval) { eval.Id = (++_evalCount).ToString(); _evals.Add(eval); return(eval); }
public void SubmitEval(Eval eval) { eval.id = Guid.NewGuid().ToString(); eval.TimeSubmitted = DateTime.Now; evals.Add(eval); }
public void SubmitEval(Eval eval) { ++evalCount; eval.Id = evalCount.ToString(); Evals.Add(eval); }