Question

I have a solution with an MVC website and a Console App. The website is hosting 2 WCF services and whenever I try to add a reference to either one in the console app, I get the following error:

The HTML document does not contain Web service discovery information. Metadata contains a reference that cannot be resolved: 'http://blah:57997/Service/DWBusinessService.svc'. Content Type application/soap+xml; charset=utf-8 was not supported by service http://blah:57997/Service/DWBusinessService.svc. The client and service bindings may be mismatched. The remote server returned an error: (415) Unsupported Media Type. If the service is defined in the current solution, try building the solution and adding the service reference again.

Both the website and the console app build fine.

Any ideas where I am going wrong here?

edit to say: I'm sure which information is pertinent to this question - feel free to request more.

Was it helpful?

Solution

Oops - Found the issue which is different to other examples I have seen on Google. For some reason I had commented out this block in my website (WCF host) web.config

<system.serviceModel>
<behaviors>
  <serviceBehaviors>
    <behavior name="">
      <serviceMetadata httpGetEnabled="true" />
      <serviceDebug includeExceptionDetailInFaults="false" />
    </behavior>
  </serviceBehaviors>
</behaviors>
<serviceHostingEnvironment multipleSiteBindingsEnabled="true" />

Putting that back in and I'm back in business.

Licensed under: CC-BY-SA with attribution
Not affiliated with StackOverflow
scroll top