Recently, I have had a lot of opportunities to write and use the Delphi service. In fact, I was not very familiar with the preparation of this service, at that time, it was only clear that the WebHandleItem that can be processed in the service can be set up to process the conditions you want. At the earliest time, it was limited to the query Field judgment for processing, however, it is found that different instances can be created in WebHandleItem and differentiated by path. It should be said that this is more convenient to use, but there is no in-depth understanding of the service program.
Last week, I handled the following problem: Previously, in order to shorten the address, I redirected the address by using the cookie and self-built Sesscion method, when the earliest delivery customers used it, there was a problem that sometimes the request could not be connected. The earliest problem was located because of the cookie settings, because at the earliest time, when you redirect to the same directory through Response, the cookie setting fails, and "windows. location "method, so the problem was located here at the very beginning, because this phenomenon cannot be reproduced well, so I didn't care too much, it happened that a project team was using this function recently, so this problem occurred, and it was easy to reproduce it in that project group. So I wanted to keep track of it completely, the problem was finally found by adding logs. The problem occurred not by setting cookies but by searching. Our design was as follows:
Set the global variable Flist in webmoudle, read the value in the cookie to search for it in filst, find it, retrieve the content, and continue subsequent operations, however, this search function is always faulty.
After checking the information on the Internet, we found that after delphi5, webmoudle not only creates one, but also creates multiple according to different needs (concurrency), which leads to our problems: added an item in Flist but cannot find the content in subsequent operations. This is because in delphi6, webmoudle will be created as needed, our design approach forms the process of adding content to the old webmoudle, and finding problems in the new webmoudle, so when such problems arise, you can perform operations by refreshing the service several times or restarting the service. The solution is to set a global flist, which does not depend on webmoudle.
In addition, the Services released in Apache and IIS are different. For example, the URLs are different. Therefore, you must pay attention to the handling of such problems during use.
A comprehensive introduction to the content of webmoudle, provided to you: http://www.newsmth.net/bbsanc.php? Path = % 2 fgroups % 2fcomp. FAQ % 2 fdelphi % 2 fnewdig % 2 ftips % 2 fothers % 2 fvclweb % 2fm. 997201375.a