现在偶遇到一种问题,在某种网络情况下(拔掉网线),客户端用soapconection as 一个接口实例,然后调用webservice的接口,会出现timed out,然后,反复出现几次timed out,此时把网线插上,以后的情况,调用Webservice接口就变成了timed out。此时,在此进程中,重新建立一个soapconnection,实例话接口,也是出现timed out的情况(此时的网络是好的,但是,再也调用不了接口了,除非重新运行该exe)。
调试欢乐多
procedure TForm1.SoapConnection1BeforeExecute(const MethodName: String;
var SOAPRequest: WideString);
var timeOut: integer;
begin
timeOut := 1000;
InternetSetOption(nil, INTERNET_OPTION_CONNECT_TIMEOUT , pointer(@timeout), sizeof(timeOut));
end;