1

My server used to communicate only with WCF client, and I added an additional access from the web using REST API. So currently the service's web.config contains two endpoints (one for each):

 <services>
  <service name="Server.Service">
    <endpoint address="" bindingConfiguration="BasicHttpBinding_IServWCF" binding="basicHttpBinding" contract="Server.IWCF" />
    <endpoint address="api" behaviorConfiguration="WebBehave" binding="webHttpBinding" contract="Server.IREST" />
  </service>
</services>

The WCF client bindings:

<bindings>
  <basicHttpBinding>
    <binding name="BasicHttpBinding_IServWCF" />
  </basicHttpBinding>
</bindings>
<client>
  <endpoint address="http://localhost:1862/ServWCF.svc"
    binding="basicHttpBinding" bindingConfiguration="BasicHttpBinding_IServWCF"
    contract="WCFServ.IWCF" name="BasicHttpBinding_IServWCF" />
</client>

Everything works OK, and I can access the server's methods from both ways - WCF and HTTP requests. The problem - I tried to use the Update Service References feature, but it fails. I get the following error message:

The client and service bindings may be mismatched. the remote server returned an error 415

When I remove the new endpoint - behaviorConfiguration="WebBehave", the update service reference works fine. Can I somehow configure the Update References to use a specific end point?

Thanks

tom redfern
  • 30,562
  • 14
  • 91
  • 126
Dana Ezer
  • 61
  • 7

0 Answers0