使用网上的例子
使用WCF头信息可以用于在调用Service的同时传递Header元数据
客户端:
ChannelFactory<IOrderProcessor> channelFactory = new ChannelFactory<IOrderProcessor>("defaultEndpoint");
IOrderProcessor orderProcessor = channelFactory.CreateChannel();
// 使用通道建立Scope
using (OperationContextScope scope = new OperationContextScope( orderProcessor as IContextChannel ))
{
IOrderProcessor orderProcessor = channelFactory.CreateChannel();
// 使用通道建立Scope
using (OperationContextScope scope = new OperationContextScope( orderProcessor as IContextChannel ))
{