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

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

 

回答2

I added a service reference as usual and got this error. Turns out all I had to do was to amend the client config to use an endpoint config with a behaviour specifing webhttp

<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 405错误,给contract的method加上WebGet这个attribute可以解决

 

作者:Chuck Lu    GitHub    
posted @   ChuckLu  阅读(64)  评论(0编辑  收藏  举报
相关博文:
阅读排行:
· 全程不用写代码,我用AI程序员写了一个飞机大战
· DeepSeek 开源周回顾「GitHub 热点速览」
· MongoDB 8.0这个新功能碉堡了,比商业数据库还牛
· 记一次.NET内存居高不下排查解决与启示
· 白话解读 Dapr 1.15:你的「微服务管家」又秀新绝活了
历史上的今天:
2021-05-05 Anti-money laundering反洗钱
2020-05-05 如何阅读git手册,方括号和尖括号的区别
2018-05-05 我最在行 英语
2015-05-05 C#编码标准
2015-05-05 面向对象设计Object Oriented Design
点击右上角即可分享
微信分享提示