locked
The content type text/html;charset=utf-8 of the response message does not match the content type of the binding RRS feed

  • Question

  • The content type text/html;
     charset=utf-8 of the response message does not match the content type of the binding (text/xml; charset=utf-8). If using a custom encoder, be sure that the IsContentTypeSupported method is implemented properly. The first 1024 bytes of the response were: '<html>     <head>         <title>Runtime Error</title>         <style>          body {font-family:"Verdana";font-weight:normal;font-size: .7em;color:black;}           p {font-family:"Verdana";font-weight:normal;color:black;margin-top: -5px}          b {font-family:"Verdana";font-weight:bold;color:black;margin-top: -5px}          H1 { font-family:"Verdana";font-weight:normal;font-size:18pt;color:red }          H2 { font-family:"Verdana";font-weight:normal;font-size:14pt;color:maroon }          pre {font-family:"Lucida Console";font-size: .9em}          .marker {font-weight: bold; color: black;text-decoration: none;}          .version {color: gray;}          .error {margin-bottom: 10px;}          .expandable { text-decoration:underline; font-weight:bold; color:navy; cursor:hand; }         </style>     </head>      <body bgcolor="white">              <span><H1>Server Error in '/' Application.<hr width=100% size=1 color=silver></H1>              <h2> <i>Runtime Error</i> </h2></span>       '.
    Friday, May 25, 2012 6:43 AM

Answers

  • It seems that the client get an html response from the web server indicates that an error page has been served, but does not get the expected content type (text/xml; charset=utf-8) for the corresponding binding. I want to know what error message (such as status code) comes back from the service? In addition, you can turn on WCF tracing at service side and client-side to see whether it can capture more detailed error information at underlying channel level.

    http://blogs.msdn.com/b/madhuponduru/archive/2006/05/18/601458.aspx


    Please mark the replies as answers if they help or unmark if not. If you have any feedback about my replies, please contact msdnmg@microsoft.com Microsoft One Code Framework

    Monday, May 28, 2012 8:42 AM

All replies

  • We are recieving above error if service in stage environment is referenced from application in stage .

    Same stage service if referenced in application in dev environment works fine ,even in console application also it gives expescted results ...however in stage application gives below error :

    The content type text/html;
     charset=utf-8 of the response message does not match the content type of the binding (text/xml; charset=utf-8). If using a custom encoder, be sure that the IsContentTypeSupported method is implemented properly. The first 1024 bytes of the response were: '<html>     <head>         <title>Runtime Error</title>         <style>          body {font-family:"Verdana";font-weight:normal;font-size: .7em;color:black;}           p {font-family:"Verdana";font-weight:normal;color:black;margin-top: -5px}          b {font-family:"Verdana";font-weight:bold;color:black;margin-top: -5px}          H1 { font-family:"Verdana";font-weight:normal;font-size:18pt;color:red }          H2 { font-family:"Verdana";font-weight:normal;font-size:14pt;color:maroon }          pre {font-family:"Lucida Console";font-size: .9em}          .marker {font-weight: bold; color: black;text-decoration: none;}          .version {color: gray;}          .error {margin-bottom: 10px;}          .expandable { text-decoration:underline; font-weight:bold; color:navy; cursor:hand; }         </style>     </head>      <body bgcolor="white">              <span><H1>Server Error in '/' Application.<hr width=100% size=1 color=silver></H1>              <h2> <i>Runtime Error</i> </h2></span>   

    Monday, May 28, 2012 6:15 AM
  • It seems that the client get an html response from the web server indicates that an error page has been served, but does not get the expected content type (text/xml; charset=utf-8) for the corresponding binding. I want to know what error message (such as status code) comes back from the service? In addition, you can turn on WCF tracing at service side and client-side to see whether it can capture more detailed error information at underlying channel level.

    http://blogs.msdn.com/b/madhuponduru/archive/2006/05/18/601458.aspx


    Please mark the replies as answers if they help or unmark if not. If you have any feedback about my replies, please contact msdnmg@microsoft.com Microsoft One Code Framework

    Monday, May 28, 2012 8:42 AM