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

发布时间 2023-05-05 15:29:58作者: ChuckLu

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>