1.C#调用java接口往数据库里插入数据
2.java程序返回给C#程序一个是否插入成功的json数据
其实就是一来一回,我是写这个java接口的人,C#程序我不熟,但是写C#程序的哥们在程序里判断,如果我服务器没有返回内容,就会再次执行上一条数据的插入操作
1.我又没关服务器,怎么可能什么东西都不返回给C#程序?例如tomcat只要没关肯定会返回状态码,无论是200还是500还是404
2.C#的哥们说他程序写的肯定没问题,也不愿意共享源码,于是我在我的Controller里做了一个日志记录,记录每次插入操作耗时,以及response里的内容,发现每次response都是有数据的
3.我现在该如何排错呢?我能想到的就是去C#程序的电脑上用fiddler抓包,看看到底是不是我服务器没返回给他程序response,不知大家有什么更好的快速定位办法,或者说我们两个程序都没问题,是机房网络有问题。
PHPz2017-04-18 09:40:54
This is obviously his problem. As long as the connection is successful, there will definitely be a status, at least there will be an http header.
If there is nothing, there is either a problem with his code or a network problem.
But no matter what, he must consider this possibility and make fault tolerance.
The interface is a passive service, what else can be done? Free shipping~~~
怪我咯2017-04-18 09:40:54
The person above is right, there is a problem with C#. Use wireshark to capture the packets on the C# program and it will be clear.
Fiddler seems to be unable to capture the program socket link. Fiddler can only capture http.