/// <summary> /// Accept a settlement. /// </summary> /// <param name="negotiationId"></param> private void AcceptSettlement(Guid negotiationId) { TradingSupportClient tradingSupportClient = new TradingSupportClient(Guardian.Properties.Settings.Default.TradingSupportEndpoint); try { tradingSupportClient.CreateConsumerTrustSettlement(negotiationId); } catch (FaultException<ArgumentFault> exception) { EventLog.Information( "Server rejected auto-accept of consumer trust negotiation {0}: {1}: {2}\n {3}", negotiationId, exception.GetType(), exception.Detail.Message, exception.StackTrace); } catch (Exception exception) { System.Diagnostics.Debug.WriteLine(String.Format("Accepting negotiation {0} failed from trust side inexplicably.", negotiationId)); EventLog.Error( "Failed to auto-settle consumer trust negotiation {0}: {1}: {2}\n {3}", negotiationId, exception.GetType(), exception.Message, exception.StackTrace); } finally { if (tradingSupportClient != null && tradingSupportClient.State == CommunicationState.Opened) tradingSupportClient.Close(); } Thread.Sleep(5000); }