Hi all. I have a problem and would like to get some points or ideas where to go to solve it:
There is a Windows service on server which has TIdHttpServer which listens for incoming messages, handles them, stores data in DB and send response with result or error message. Works for several years now, several messages per day, few MB at max.
TIdHttpServer handles messages in OnIdHTTPServerCommandGet handler. Whole process is logged in event viewer.
Last week communication stopped. Every message is accepted, handled and stored in db, but when response object is filled, it is not delivered. Event viewer reports all the steps of handling correctly. There is 5 min wait and then exception is raised in OnIdHTTPServerCommandGet function which is also presented in Event viewer.
On TIdHttpServer side error is raised as exception after 5 min:
Socket Error # 10054 Connection reset by peer.
On Sender side error is:
2020-12-01 08:20:21 [pool-1-thread-5] DEBUG com.b2b.jms2ws - header-generator =>
2020-12-01 08:20:21 [pool-1-thread-5] DEBUG com.b2b.jms2ws.dochandle - Posting to: http://IPADDRESS:PORT
2020-12-01 08:25:54 [pool-1-thread-5] ERROR com.b2b.framework-base - org.apache.http.NoHttpResponseException: The target server failed to respond
I made a local test and service is not responding in timely manner on server where service runs! So problem is between service and Windows enviroment.
Firewall is checked and it doesn't block. I made a desktop app with same TIdHttpServer units working and started it instead of service. Communication is working in both ways, no connection timeouts even when message is comming from outside network.
Have you experineced similar problem? Do you have any advice where/what to look?
Code is:
procedure TFrmDesktopTest.IdHTTPServer2CommandGet(AContext: TIdContext;
ARequestInfo: TIdHTTPRequestInfo; AResponseInfo: TIdHTTPResponseInfo);
var
PorukaObjekt: TSpremanjePrimljenePoruke;
begin
if ARequestInfo.PostStream <> nil then
begin
PorukaObjekt := TSpremanjePrimljenePoruke.Create(ConnString, InvisibleHandle);
try
try
if not PorukaObjekt.IskopirajStream(ARequestInfo.PostStream) then
raise Exception.Create('Stream handling error ');
// logging function to enter data in Event viewer
LogPoruka('PorukaObjekt.Execute');
if not PorukaObjekt.Execute then
raise Exception.Create('Store in DB error. ' + PorukaObjekt.AInfo);
AResponseInfo.ContentText := '<SOAP:Envelope xmlns:SOAP=''http://schemas.xmlsoap.org/soap/envelope/''>' +
'<SOAP:Header/><SOAP:Body><Response status=''0''><Description>SUCCESS</Description></Response></SOAP:Body></SOAP:Envelope>';
except
On E:Exception do begin
AResponseInfo.ContentText := '<SOAP:Envelope xmlns:SOAP=''http://schemas.xmlsoap.org/soap/envelope/''>' +
'<SOAP:Header/><SOAP:Body><Response status=''1''><Description>E.Message +
'</Description></Response></SOAP:Body></SOAP:Envelope>';
LogPoruka(AResponseInfo.ContentText);
end;
end;
finally
FreeAndNil(PorukaObjekt);
end;
end;
end;
Thanks in advance
Frano