bitschieber Posted March 6, 2014 Share Posted March 6, 2014 Hi all!We are trying to combine the TUniServerModule with ourREST-WebService-component (customized Indy HttpServer).In this case, is there any posibility to get an event like Indy'sHttp-Server 'OnCommandGet' or 'OnCommandOther' to handle individualhttp-reqeusts? We want to use only one port in the whole application toavoid cross-domain problems.Thanks a lot 1 Link to comment Share on other sites More sharing options...
Administrators Farshad Mohajeri Posted March 6, 2014 Administrators Share Posted March 6, 2014 Moved to Feature Requests. 1 Link to comment Share on other sites More sharing options...
Administrators Farshad Mohajeri Posted March 6, 2014 Administrators Share Posted March 6, 2014 Can you specify more details? 1 Link to comment Share on other sites More sharing options...
bitschieber Posted March 7, 2014 Author Share Posted March 7, 2014 We are currently using self-programmed components which communicate via web services rest. We want to include these components in our Unigui application. That is why we need a service of Unigui and REST Web services can operate. A proposed solution would be to declare public 'OnCommandGet' and 'OnCommandOther'. 1 Link to comment Share on other sites More sharing options...
bitschieber Posted March 10, 2014 Author Share Posted March 10, 2014 Thanks for the quick adjustment, it works as desired. Great future: 0001343: Server event to handle all HTTP calls. Thank you Link to comment Share on other sites More sharing options...
bitschieber Posted March 14, 2014 Author Share Posted March 14, 2014 Hi! Thanks a lot for implementing the new OnHttpCommand-Event, it was really helpful! But we noticed that not all common http-methods are supported in this event, for example DELETE, PUT or OPTIONS. Only GET and POST are still working. To implement an entire REST-ful webservice, we do need the methods: GET, PUT, POST, DELETE and OPTIONS. Is there any way to get the "OnHttpCommand"-event triggered on those HTTP-standarded methods? Thanks a lot! Link to comment Share on other sites More sharing options...
Administrators Farshad Mohajeri Posted March 15, 2014 Administrators Share Posted March 15, 2014 It will be fixed in next version.. Workaround: unit ServerModule; interface uses SysUtils, uniGUIServer, uniGUIMainModule, uniGUIApplication, // add uIdContext, uIdCustomHTTPServer, ExtHTTPServer; // add type TUniServerModule = class(TUniGUIServerModule) procedure UniGUIServerModuleHTTPCommand(ARequestInfo: TIdHTTPRequestInfo; AResponseInfo: TIdHTTPResponseInfo; var Handled: Boolean); private { Private declarations } protected procedure FirstInit; override; public { Public declarations } // add procedure CommandOther(AContext: TIdContext; ARequestInfo: TIdHTTPRequestInfo; AResponseInfo: TIdHTTPResponseInfo); procedure AfterConstruction; override; // add end; function UniServerModule: TUniServerModule; implementation {$R *.dfm} uses UniGUIVars; function UniServerModule: TUniServerModule; begin Result:=TUniServerModule(UniGUIServerInstance); end; procedure TUniServerModule.FirstInit; begin InitServerModule(Self); end; // add procedure TUniServerModule.AfterConstruction; begin inherited; ExtApplication.Server.OnCommandOther := CommandOther; end; procedure TUniServerModule.CommandOther(AContext: TIdContext; ARequestInfo: TIdHTTPRequestInfo; AResponseInfo: TIdHTTPResponseInfo); begin // end; // add procedure TUniServerModule.UniGUIServerModuleHTTPCommand(ARequestInfo: TIdHTTPRequestInfo; AResponseInfo: TIdHTTPResponseInfo; var Handled: Boolean); begin // end; initialization RegisterServerModuleClass(TUniServerModule); end. Link to comment Share on other sites More sharing options...
bitschieber Posted March 15, 2014 Author Share Posted March 15, 2014 Thanks for the quick help. Link to comment Share on other sites More sharing options...
shawdown Posted January 16, 2018 Share Posted January 16, 2018 Any way for this to work with isapi? Link to comment Share on other sites More sharing options...
Recommended Posts