soon
-
Posts
5 -
Joined
-
Last visited
Content Type
Profiles
Forums
Events
Posts posted by soon
-
-
May I know what is the best way to develop a multi-module system using UNIGUI ?
We have to split the system into several modules and handle by different developer.
Instead of making whole system into one exe, what are the possibility to split them and control by a main menu ?
Example :
<MAIN MENU>
-> MODULE A
-> MODULE B
-> MODULE C
-> MODULE D
-> MODULE E
How does UNIGUI link them together with 1 session per user ?
thank you
-
@soon: yes, the indy http client.
Below is a function I previously used to send SMS via a phone operator web service, using http.get and no ssl:
function TuniMainModule.SendSMS(number, msg:string):string;constcUSER_AGENT = 'Mozilla/4.0 (MSIE 6.0; Windows NT 5.1)';varhttpResponse: string;Stream: TStringStream;URL, telParams:string;HTTP:TidHTTP;beginStream := TStringStream.Create;HTTP:=TIdHTTP.Create(nil);HTTP.ReadTimeout := 10000;{ IdTimeoutInfinite; }HTTP.ConnectTimeout := 10000;tryHTTP.Request.UserAgent := cUSER_AGENT;tryHTTP.Get(URL, Stream);result:= Stream.DataString;exceptresult:= 'SMS Error!';end;finallyStream.Free;HTTP.Free;end;end;If you want basic http auth then add:HTTP.Request.BasicAuthentication:=true;HTTP.Request.Username:=username;HTTP.Request.Password:=pw;If you need SSL, add:varLHandler: TIdSSLIOHandlerSocketOpenSSL;...tryLHandler := TIdSSLIOHandlerSocketOpenSSL.Create(nil);...
HTTP.IOHandler:=LHandler;
finally
LHandler.Free;
etc.
If you need to POST, use HTTP.Post(url, aParams, aResponse);
Notice: using GET you have to think about encoding, since this is
part of the URL, but when using POST there is no worry about that.
ok, thank you so much for your help
-
I don't have an example right now, but a web service is basically just an HTTP server,
so use any HTTP client and make a call, and read the result, XML or JSON....parse it,
push it into a table and refresh the query linked to your grid, and there you have it.
I like using the Indy components, the HTTP client is blocking, so use a thread if you
have to, but it is very easy to set up and there are tons of examples on the net.
Do you mean TIdHTTP ?
-
Hi all, im new to UNIGUI
Can anyone provide a sample of how does Unigui client call API/web services with parameters and read the returned JSON data list and display in grid ?
thank you
Multi-Module development
in General
Posted
Any recommendation ?
is the UniUrlFrame the best choice ?