[问题描述]
在业务中与第三方对接时,在11秒log显示开始发起请求,24秒接受到请求结果,显示“请求序列号重复,请求失败”。查询log确认这段程序只触发一次,对方给出的日志显示第一次请求11秒接收,14秒给出返回结果,23秒收到同一序列号的请求,给出请求失败的response。
[代码段]
/**
* 向指定URL发送POST方法的请求
*
* @return URL所代表远程资源的响应
* @throws Exception
*/
public static String sendPost(String tr1XML, String postUrl, String authString, int timeOutSecond, KeyManager[] keyManagers) throws Exception {
log.info("发送tr1报文:{}", tr1XML);
ParseXMLUtil parseUtil = new ParseXMLUtil();
OutputStream out = null;
String reqData = null;
try {
HttpsURLConnection conn = (HttpsURLConnection) createConnection(postUrl, authString, timeOutSecond, keyManagers);
// 获取URLConnection对象对应的输出流
out = conn.getOutputStream();
//发送请求参数
out.write(tr1XML.getByt