locked
The content type text/html of the response message does not match the content type of the binding RRS feed

  • Question

  • User-2011931782 posted

    Hi All,

    I am getting following errors while push data using a wcf service. Not getting proper solution to fix this problem. Can anyone help me here.

    Message:The content type text/html of the response message does not match the content type of the binding (application/soap+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:

    Monday, February 19, 2018 8:52 AM

Answers

  • User475983607 posted

    shailendra3009

    Thanks for your reply.

    We don't have access to WCF service. But if there is error in WCF code then how can we make it sure with out looking into service code ?

    Please suggest.

    The error means the client was expecting a SOAP response but received an html response.  The HTML usually contains an error message in this situation - the yellow screen of death.  It also means, IMHO, that the WCF service has issues as you should never see an HTML response.  You should see a SOAP fault.

    You'll need to contact the WCF owner for support.  There is not much we can do on the forum as we cannot see the WCF source code or your code.

    • Marked as answer by Anonymous Thursday, October 7, 2021 12:00 AM
    Tuesday, February 20, 2018 11:50 AM
  • User753101303 posted

    500 - Internal server error

    This status code means there is a server side error on their side. If you can get this 500 status information when processing this kind of error, then you can safely consider that there is an execution error in server side code.

    • Marked as answer by Anonymous Thursday, October 7, 2021 12:00 AM
    Tuesday, February 20, 2018 11:56 AM

All replies

  • User753101303 posted

    Hi,

    Seems you get an HTML page as a response and the content of this page could give a clue about what happens. Have you tried to look at the actual content you are receiving for now? Could it be some kind of HTML error pages ?

    Monday, February 19, 2018 9:13 AM
  • User-2011931782 posted

    Thanks for you reply.

    Yes, it is showing some HTML content in response. After the message, it has below HTML text in response.

    '<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Strict//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-strict.dtd">
    <html xmlns="http://www.w3.org/1999/xhtml">
    <head>
    <meta http-equiv="Content-Type" content="text/html; charset=iso-8859-1"/>
    <title>500 - Internal server error.</title>
    <style type="text/css">
    <!--
    body{margin:0;font-size:.7em;font-family:Verdana, Arial, Helvetica, sans-serif;background:#EEEEEE;}
    fieldset{padding:0 15px 10px 15px;}
    h1{font-size:2.4em;margin:0;color:#FFF;}
    h2{font-size:1.7em;margin:0;color:#CC0000;}
    h3{font-size:1.2em;margin:10px 0 0 0;color:#000000;}
    #header{width:96%;margin:0 0 0 0;padding:6px 2% 6px 2%;font-family:"trebuchet MS", Verdana, sans-serif;color:#FFF;
    background-color:#555555;}
    #content{margin:0 0 0 2%;;}
    .content-container{background:#FFF;width:96%;margin-top:8px;padding:10px;;}
    -->
    </style>
    </head>
    <body>
    <div id="header"><h1>Server Error</h1></div>
    <div id="content">
    <div class="content-container"><fieldset>

    Monday, February 19, 2018 9:38 AM
  • User-2011931782 posted

    Can you please advice, does it have to do anything with Binding mismatch at server and client ??

    Monday, February 19, 2018 10:25 AM
  • User753101303 posted

    Check also the status code. It seems an http 500 error ie you have an exception while your service code is running. By default the exception message should be written to the Windows event log.

    Monday, February 19, 2018 11:36 AM
  • User1168443798 posted

    Hi shailendra,

    How did you generate the WCF Client?

    For this error, it seems the WCF Service throw error in HTML Format instead of WCF Fault. 

    Does this error throw for all the WCF Method? If not, I suggest you debug the specific method to check whether there is any error in Service side.

    I suggest you enable WCF Tracing to check the depth error message.

    If possible, it would be helpful if you could share us detail steps to reproduce your issue.

    Best Regards,

    Edward

    Monday, February 19, 2018 1:17 PM
  • User-2011931782 posted

    Thanks for your reply.

    We don't have access to WCF service. But if there is error in WCF code then how can we make it sure with out looking into service code ?

    Please suggest.

    Tuesday, February 20, 2018 11:36 AM
  • User475983607 posted

    shailendra3009

    Thanks for your reply.

    We don't have access to WCF service. But if there is error in WCF code then how can we make it sure with out looking into service code ?

    Please suggest.

    The error means the client was expecting a SOAP response but received an html response.  The HTML usually contains an error message in this situation - the yellow screen of death.  It also means, IMHO, that the WCF service has issues as you should never see an HTML response.  You should see a SOAP fault.

    You'll need to contact the WCF owner for support.  There is not much we can do on the forum as we cannot see the WCF source code or your code.

    • Marked as answer by Anonymous Thursday, October 7, 2021 12:00 AM
    Tuesday, February 20, 2018 11:50 AM
  • User753101303 posted

    500 - Internal server error

    This status code means there is a server side error on their side. If you can get this 500 status information when processing this kind of error, then you can safely consider that there is an execution error in server side code.

    • Marked as answer by Anonymous Thursday, October 7, 2021 12:00 AM
    Tuesday, February 20, 2018 11:56 AM