WCF Service Client: The content type text/html; charset=utf-8 of the response message does not match the content type of the binding

后端 未结 19 2247
情书的邮戳
情书的邮戳 2020-11-27 18:30

I\'ve got a WCF Service running on my local IIS server. I\'ve added it as a service reference to a C# Website Project and it adds fine and generates the proxy classes automa

相关标签:
19条回答
  • 2020-11-27 18:53

    I had a similar issue. I resolved it by changing

    <basicHttpBinding>
    

    to

    <basicHttpsBinding>
    

    and also changed my URL to use https:// instead of http://.

    Also in <endpoint> node, change

    binding="basicHttpBinding" 
    

    to

    binding="basicHttpsBinding"
    

    This worked.

    0 讨论(0)
  • 2020-11-27 18:54

    I solved this problem by setting UseCookies in web.config.

      <system.web>
        <sessionState cookieless="UseCookies" />
    

    and setting enableVersionHeader

      <system.web>
        <httpRuntime targetFramework="4.5.1" enableVersionHeader="false" executionTimeout="1200" shutdownTimeout="1200" maxRequestLength="103424" />
    
    0 讨论(0)
  • 2020-11-27 18:55

    Even if you don't use network proxy, turning 'Automatically detect settings' in proxy dialog makes this exception go off.

    enter image description here

    0 讨论(0)
  • 2020-11-27 18:55

    My solution was rather simple: backup everything from the application, uninstall it, delete everything from the remaining folders (but not the folders so I won't have to grant the same permissions again) then copy back the files from the backup.

    0 讨论(0)
  • 2020-11-27 18:59

    As with many, in my situation I was also getting this because of an error. And sadly I could just read the CSS of the html error page.

    The source of my problem was also a rewrite rule on the server. It was rewriting http to https.

    0 讨论(0)
  • 2020-11-27 18:59

    I tried all the suggestions above, but what worked in the end was changing the Application Pool managed pipeline from Integrated mode to Classic mode.
    It runs in its own application pool - but it was the first .NET 4.0 service - all other servicves are on .NET 2.0 using Integrated pipeline mode. Its just a standard WCF service using is https - but on Server 2008 (not R2) - using IIS 7 (not 7.5) .

    0 讨论(0)
提交回复
热议问题