Skip to content

Instantly share code, notes, and snippets.

@skenderbeu
Last active June 11, 2018 16:26
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save skenderbeu/d2872138f9cd9c9223cb25db2f7cf868 to your computer and use it in GitHub Desktop.
Save skenderbeu/d2872138f9cd9c9223cb25db2f7cf868 to your computer and use it in GitHub Desktop.
using System;
using System.IO;
using System.ServiceModel.Channels;
namespace RoyalMail
{
public class ResponseMessage: LogMessage
{
private Guid guid;
public ResponseMessage(Guid guid)
{
fileName = string.Format("{0}RoyalMailLog_{1:000}_{2}_Incoming.txt",
Properties.Settings.Default.RoyalMailLog, GetDateStamp(), guid);
this.guid = guid;
}
protected override void CreateMessage(Message message, StreamWriter sw)
{
sw.WriteLine("Response to request to {0}:", guid);
HttpResponseMessageProperty httpResp =
(HttpResponseMessageProperty)message.Properties[HttpResponseMessageProperty.Name];
sw.WriteLine("{0} {1}", (int)httpResp.StatusCode, httpResp.StatusCode);
}
}
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment