你好,
在创建客户端信道工厂的时候需要添加“WebHttpBehavior”。
如在代码中可以参考:
var factory = new ChannelFactory<IService>(new WebHttpBinding(), uri);
factory.Endpoint.Behaviors.Add(new WebHttpBehavior());
var proxy = factory.CreateChannel();
如在配置文件中可以参考下面:
<client>
<endpoint address="http://localhost:9000/GeoConverterService/GeoConverterService.svc"
binding="webHttpBinding" contract="GeoConverter.IGeoConverterService" behaviorConfiguration="webhttp"/>
</client>
<behaviors>
<endpointBehaviors>
<behavior name="webhttp">
<webHttp/>
</behavior>
</endpointBehaviors>
</behaviors>
这里有相似的问题, 你可以看一下:
http://stackoverflow.com/questions/21204638/wcf-error-on-execute-manual-addressing-is-enabled-on-this-factory-so-all-messa
http://stackoverflow.com/questions/1798069/wcf-error-manual-addressing-is-enabled-on-this-factory-so-all-messages-sent-m
谢谢
We are trying to better understand customer views on social support experience, so your participation in this interview project would be greatly appreciated if you have time. Thanks for helping make community forums a great place. <br/> Click <a
href="http://support.microsoft.com/common/survey.aspx?showpage=1&scid=sw%3Ben%3B3559&theme=tech"> HERE</a> to participate the survey.