WCF自定义Header
MiscWebSrvcInfClient client = new MiscWebSrvcInfClient("MiscWSBeanPort", ConfigurationManager.AppSettings["WSMiscService"]); using (OperationContextScope scope = new OperationContextScope(client.InnerChannel)) { //添加header foreach (var item in headers) { MessageHeader header = MessageHeader.CreateHeader(item.Key, string.Empty, item.Value); OperationContext.Current.OutgoingMessageHeaders.Add(header); } }
原创文字只代表本人某一时间内的观点或结论,本人不对涉及到的任何代码担保。转载请标明出处!