Forum > Networking and Web Programming
App freezes consuming webservice with the WebService Toolkit
(1/1)
felipemdc:
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.
Phil:
Does it make any difference if you use INDY_RegisterHTTP_Transport?
I've used WST / Indy with a variety of Web services and haven't seen this. Normally if the Web service is unavailable (weekend maintenance, maybe), then I get a server not available exception after a few seconds.
Are you using the current WST from SVN?
Thanks.
-Phil
xenblaise:
hi
can we play that game? can you show as the link. :D
I'd like to play chess with lazarus app ONLY.
ridsonxm:
How I Faso to compile this project?
What compunentes that must be installed in Lazarus?
xenblaise:
Where the link that I could ran the chess app?
Navigation
[0] Message Index