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:
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 ?
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.
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
MSDN Community Support
Please remember to click "Mark as Answer" the responses that resolved your issue.
If you have any compliments or complaints to MSDN Support, feel free to contact MSDNFSF@microsoft.com.
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.
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.
Member
309 Points
179 Posts
The content type text/html of the response message does not match the content type of the binding...
Feb 19, 2018 08:52 AM|shailendra3009|LINK
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:
Sh@ilendr@
All-Star
48570 Points
18086 Posts
Re: The content type text/html of the response message does not match the content type of the bin...
Feb 19, 2018 09:13 AM|PatriceSc|LINK
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 ?
Member
309 Points
179 Posts
Re: The content type text/html of the response message does not match the content type of the bin...
Feb 19, 2018 09:38 AM|shailendra3009|LINK
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%;position:relative;}
.content-container{background:#FFF;width:96%;margin-top:8px;padding:10px;position:relative;}
-->
</style>
</head>
<body>
<div id="header"><h1>Server Error</h1></div>
<div id="content">
<div class="content-container"><fieldset>
Sh@ilendr@
Member
309 Points
179 Posts
Re: The content type text/html of the response message does not match the content type of the bin...
Feb 19, 2018 10:25 AM|shailendra3009|LINK
Can you please advice, does it have to do anything with Binding mismatch at server and client ??
Sh@ilendr@
All-Star
48570 Points
18086 Posts
Re: The content type text/html of the response message does not match the content type of the bin...
Feb 19, 2018 11:36 AM|PatriceSc|LINK
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.
Contributor
3310 Points
1607 Posts
Re: The content type text/html of the response message does not match the content type of the bin...
Feb 19, 2018 01:17 PM|Edward Z|LINK
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
Please remember to click "Mark as Answer" the responses that resolved your issue.
If you have any compliments or complaints to MSDN Support, feel free to contact MSDNFSF@microsoft.com.
Member
309 Points
179 Posts
Re: The content type text/html of the response message does not match the content type of the bin...
Feb 20, 2018 11:36 AM|shailendra3009|LINK
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.
Sh@ilendr@
All-Star
53131 Points
23682 Posts
Re: The content type text/html of the response message does not match the content type of the bin...
Feb 20, 2018 11:50 AM|mgebhard|LINK
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.
All-Star
48570 Points
18086 Posts
Re: The content type text/html of the response message does not match the content type of the bin...
Feb 20, 2018 11:56 AM|PatriceSc|LINK
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.