Exemple #1
0
        public static void SetHeader <TContent>(WCFHeader <TContent> wcfHeader)
        {
            MessageHeader <TContent> header  = new System.ServiceModel.MessageHeader <TContent>(wcfHeader.Content);
            MessageHeader            untyped = header.GetUntypedHeader(wcfHeader.Name, wcfHeader.HeaderNamespace);

            OperationContext.Current.OutgoingMessageHeaders.Add(untyped);
        }
Exemple #2
0
 public static TResult GetHeader <TResult>(WCFHeader <TResult> header, TResult defaultValue)
 {
     try
     {
         return(GetHeader(header));
     }
     catch (MessageHeaderException)
     {
         return(defaultValue);
     }
 }
Exemple #3
0
 public static TResult GetHeader <TResult>(WCFHeader <TResult> header)
 {
     return(OperationContext.Current.IncomingMessageHeaders.GetHeader <TResult>(header.Name, header.HeaderNamespace));
 }