using System;
using System.Collections.Generic;
using System.Linq;
using System.ServiceModel.Channels;
using System.ServiceModel.Dispatcher;
using System.Text;

namespace MemoQServicesClient.WCF
{
    class MemoQServicesClientMessageInspector : IClientMessageInspector
    {
        public void AfterReceiveReply(ref System.ServiceModel.Channels.Message reply, object correlationState)
        {

        }

        public object BeforeSendRequest(ref System.ServiceModel.Channels.Message request, System.ServiceModel.IClientChannel channel)
        {
            request.Headers.Add(MessageHeader.CreateHeader(WsApiKeyConfig.ApiKeyHeaderKey, WsApiKeyConfig.ApiKeyNamespace, WsApiKeyConfig.ApiKeyHeaderValue));
            return null;
        }
    }
}
