Hello,
I read the wiki, and I wrote a simple chess game which connects to the Borland chess webservice. The full chess game can be downloaded here:
svn co
https://lazarus-ccr.svn.sourceforge.net/svnroot/lazarus-ccr/applications/fpchess lazarus-ccr
And then I created the following routine to call the only function in the webservice.
Note that accessing the webservice from a soap test web page works correctly and it returns me the result which I expected.
My problem is that when I call this function the program just hangs! Any idea what is wrong? I used the Lazarus WebService Toolkit package to install a menu item which generated the pascal files for the webservice comsuption. Here is the function:
unit IDelphiChess_Intf;
{$mode objfpc}{$H+}
interface
uses
Classes, SysUtils,
IDelphiChessWSDL, IDelphiChess_proxy, chessgame, httpsend;
procedure GetNextMoveFromBorlandWS();
implementation
function ReadEntry(const APromp : string):string ;
begin
Result := '';
Write(APromp);
while True do begin
ReadLn(Result);
Result := Trim(Result);
if ( Length(Result) > 0 ) then
Break;
end;
end;
procedure GetNextMoveFromBorlandWS();
var
locService : IDelphiChess;
rsps : string;
begin
Register_IDelphiChess_ServiceMetadata();
// SYNAPSE_RegisterHTTP_Transport();
locService := wst_CreateInstance_IDelphiChess();
rsps := locService.XML_GetNextMove(
'', True, 5);
end;
end.
I am using Synapse, so I know it is blocking sockets, but I expect that it should return something after some time, but it just stays frozen forever.