Delphi Soap WebServer does not allow more than two calls at a time

I have a problem with SOAP WebServer: if I have a method on the server that takes a few seconds to give a result, and I cannot make more than two calls "simoultaneously" (called from threads) from my client application (developed in Delphi. Also - for testing only, the final client application will be based on the Internet). I mean, the streams are somehow serialized, and I don’t know if this should happen this way, or if I am doing something wrong or I need to make a certain setting.

Delphi XE2 Professional, Windows 7 64-bit

Link to my archived project: http://1drv.ms/Nwu9nY

Server Method:

function TServiciu.Test: string;
var t0, t1, Duration : Cardinal;
    Guid : tguid;
    RGuid : HRESULT;
    received : boolean;
const MaxTime : Cardinal = 3000;
begin
  Result := '';
  RGuid := CreateGuid(Guid);
  if RGuid = S_OK then
    Result := GuidToString(Guid);
  t0 := GetTickCount;
  t1 := GetTickCount;
  duration := t1 - t0;
  while (Duration < Maxtime) do begin
    //waiting for something to be written in a db by another program
    //I am doing querys to the database for that result
    if received then begin
      Result := Result + '_RECEIVED_' + DateTimeToStr(Now);
      Break;
    end;
    t1 := GetTickCount;
    duration := t1 - t0;
    if duration > Maxtime then begin //MaxTime allowed is exceded
      Result := Result + '_NOTRECEIVED_' + DateTimeToStr(Now);
      Break;
    end;
  end;
end;

:

procedure TThreadTest.Execute;
begin
  try
    // OleCheck will raise an error if the call fails
    OleCheck(CoInitializeEx(NIL, COINIT_MULTITHREADED or COINIT_SPEED_OVER_MEMORY));
    try
      s := 'Calling Method Test; Result=' +
      Self.ThGetService.Test;
      Synchronize(self.ScrieRezultat); //write result in memo
    finally
      CoUninitialize;
      FreeAndNil(self.ThHttprio);
    end;
  except
    // We failed, do something
  end;
end;
+4
3

, , , HTTP 1.1. HTTP 1.1 . http://support2.microsoft.com/kb/183110

+1

40 ( ), . - CGI, IIS . SOAP, IIS myapp_cgi.exe . 40 TPS, 4 , 160 TPS, , .

+1

I had a very similar problem and I am sure that your problem is not on your server, but on your client. See this topic here.

0
source

Source: https://habr.com/ru/post/1532621/


All Articles