Friends have a project, the communication protocol uses HTTP, and the data sequence uses bin (binary). He did not know what technical plan to use.
REST WebService is Http+json,soap WebService is http+xml, it seems not suitable.
So I thought of the Tidhttpserver control using Indy to implement. Tidhttpserver can implement WebService middleware.
Limited to space, omitting several codes.
Middleware Code:
Set binding parameters
IdHTTPServer1.Bindings.Clear;
Idhttpserver1.defaultport:= 8000;
IdHTTPServer1.Bindings.Add.IP: = ' 127.0.0.1 ';
Start the server
Idhttpserver1.active: = True;
Procedure Tform1.idhttpserver1commandget (Acontext:tidcontext;
Arequestinfo:tidhttprequestinfo; Aresponseinfo:tidhttpresponseinfo);
Begin
Memo1. Lines.add (arequestinfo.document);
Memo1. Lines.add (Arequestinfo. params.values[' T1 ');
Memo1. Lines.add (Arequestinfo. params.values[' T2 ');
End
IE Browser input: HTTP://127.0.0.1:8000/TEST?T1=CHINA&T2=CXG
Middleware execution:
Above is the method of invoking the middleware through the Get method of HTTP and passing parameters, also, the post of HTTP can.
A few lines, you can achieve a super-invincible simple WebService middleware. I do not know you see, so simple middleware has a flexible place: its data sequence format can be text, JSON, XML, or bin.
http://www.cnblogs.com/hnxxcxg/p/3395524.html------------------------------------------------------------------I modeled this tutorial. The results are not responding, help to see where the problem. Thanks, sir.
You're the one who realized webservice, what's the use, Apache?
You just use Idhttpserver. Then implement a simple HTTP server, embedded an HTML page, you can post data to your server, idhttpserver response to the post message and saved to the current directory is OK
Idhttpserver Realization WebService (130 articles Datasnap)