WCF Error : Manual addressing is enabled on this factory, so all messages sent must be pre-addressed

后端 未结 4 698
臣服心动
臣服心动 2021-01-01 08:33

I\'ve got a hosted WCF service that I created a custom factory for, so that this would work with multiple host headers:

/// 
/// Required for          


        
4条回答
  •  梦谈多话
    2021-01-01 09:19

    I experienced this error and the problem was resolved by adding the WebHttpBehavior (line 2 below):

    var factory = new ChannelFactory(new WebHttpBinding(), uri);
    factory.Endpoint.Behaviors.Add(new WebHttpBehavior());
    var proxy = factory.CreateChannel();
    

提交回复
热议问题