首页 新闻 会员 周边 捐助

.net调用webservice接口报错

0
[待解决问题]

场景:有十条数据通过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'.)

求助如何分析和解决这个问题。

Justin-Liu的主页 Justin-Liu | 菜鸟二级 | 园豆:206
提问于:2023-03-31 10:35
< >
分享
所有回答(2)
0
dudu | 园豆:30778 (高人七级) | 2023-03-31 10:49

对方系统已经接收到我传的数据,而且也处理完正常返回给我了,感觉是接收返回值时出了问题

支持(0) 反对(0) Justin-Liu | 园豆:206 (菜鸟二级) | 2023-03-31 13:33
0

你设计接口的时候要考虑这个问题,就是你在推送数据的时候,强制需要对方返回对应的code=200 或者其他标识。你这边得到反馈返回值就认为成功,否则认为推送失败,然后每30分钟推送一次,最多推送10次,10次后还是无法确认成功,就不再推送,然后就是对方查看日志解决问题。

南宫懿痕 | 园豆:298 (菜鸟二级) | 2023-03-31 14:04
清除回答草稿
   您需要登录以后才能回答,未注册用户请先注册