场景:有十条数据通过webservice接口传给其他系统,9条成功,1条失败,而且失败的1条重推也不会报错,没法稳定复现,记下来的异常是:
One or more errors occurred. (
The content type text/html 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>
<meta http-equiv="Content-Type" content="text/html; charset=utf-8" />
<title>URL过滤</title>
<link href="../css/terminal.css" rel="stylesheet" type="text/css" />
</head>
<script language="JavaScript" type="text/JavaScript">
// Added by csz in [2011-9-13] for the customize for malaysia: access denied page should show ip addr information etc.
var strShow = "According to the access control policy, you are not allowed to access this website. If you have any doubt, please contact the network administrator.";
function defendXSSReplace(str){
var s = "";
if(str.length == 0) return "";
s = str.replace(/&/g,"&");
s = s.replace(/</g,"<");
s = s.replace(/>/g,">");
s = s.replace(/ /g," ");
s = s.replace(/'/g,"'");
s = s.replace(/"/g,""");
return s;
}
function getParamString(name)
{
var strHref = window.location.href;
var intPos = strHref.indexOf("?");
if(-1 == intPos)
{
return '';
}
var strRight = strHref.substr(intPos + 1); // get'.)
求助如何分析和解决这个问题。
你设计接口的时候要考虑这个问题,就是你在推送数据的时候,强制需要对方返回对应的code=200 或者其他标识。你这边得到反馈返回值就认为成功,否则认为推送失败,然后每30分钟推送一次,最多推送10次,10次后还是无法确认成功,就不再推送,然后就是对方查看日志解决问题。