using System.ServiceModel;
using System.ServiceModel.Channels;
using System.ServiceModel.Dispatcher;

namespace BeWo.Security
{
    public class SecurityHeaderInterceptor : IClientMessageInspector
    {
        public void AfterReceiveReply(ref Message reply, object correlationState)
        {
        }

        public object BeforeSendRequest(ref Message request, IClientChannel channel)
        {
            request.Headers.Add(new SecurityHeader { Username = BeWoApp.UserName, Password = BeWoApp.UserPassword });
            return null;
        }
    }
}