![](/img/trans.png)
[英]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)
[英]webservice error: The content type text/html of the response message does not match the content type of the binding
我創建了C#項目,並將“ Web服務”添加為“服務參考”。 我的服務幾乎一直都運行良好,但有時會出現以下錯誤:
響應消息的內容類型text / html與綁定的內容類型不匹配(text / xml; charset = utf-8)。 如果使用自定義編碼器,請確保正確實施IsContentTypeSupported方法。 響應的前13個字節為:
'<HTML></HTML>'
。
我用這個谷歌搜索了這個錯誤,但是我沒有找到與此相關的所有信息,所有與WCF有關的搜索結果
此錯誤最重要的一點是“響應為: '<HTML></HTML>'
”客戶端期望“ xml響應”,但是服務器響應為空的“ html響應”
您能請教出什么問題嗎?
[編輯]我的代碼很簡單:
webserv.Insert_ImageSoapClient myservice = new webserv.Insert_ImageSoapClient();
string response = myservice.insert_x(station_id_x, time_t);
聽起來好像Web服務出錯並返回HTML頁面。
聲明:本站的技術帖子網頁,遵循CC BY-SA 4.0協議,如果您需要轉載,請注明本站網址或者原文地址。任何問題請咨詢:yoyou2525@163.com.