Added a few example based on the obsolete libraries (v0).

Updated the tutorial example.
Added WSF_MESSAGE_EXECUTION.
This commit is contained in:
2015-06-10 16:49:23 +02:00
parent b790c7fd21
commit 0e3e97a7fd
68 changed files with 3282 additions and 324 deletions

View File

@@ -11,30 +11,31 @@ class
HELLO_APPLICATION
inherit
WSF_RESPONSE_SERVICE
WSF_LAUNCHABLE_SERVICE
redefine
initialize
end
create
make_and_launch
feature {NONE} -- Initialization
make_and_launch
initialize
local
launcher: WSF_DEFAULT_SERVICE_LAUNCHER
opts: detachable WSF_SERVICE_LAUNCHER_OPTIONS
do
--| Uncomment the following line, to read options from "ewf.ini" configuration file
-- create {WSF_SERVICE_LAUNCHER_OPTIONS_FROM_INI} opts.make_from_file ("ewf.ini")
create launcher.make_and_launch (Current, opts)
Precursor
--| Uncomment the following 2 lines, to read options from "ewf.ini" configuration file
-- create {WSF_SERVICE_LAUNCHER_OPTIONS_FROM_INI} opts.make_from_file ("ewf.ini")
-- import_service_options (opts)
end
feature {NONE} -- Initialization
response (req: WSF_REQUEST): WSF_PAGE_RESPONSE
launch (opts: detachable WSF_SERVICE_LAUNCHER_OPTIONS)
local
launcher: WSF_DEFAULT_SERVICE_LAUNCHER [HELLO_EXECUTION]
do
create Result.make
Result.put_string ("Hello World")
create launcher.make_and_launch (opts)
end
end

View File

@@ -0,0 +1,35 @@
note
description: "[
Request execution for Current application.
Implement `execute' based on `request' and `response'.
]"
author: "$Author$"
date: "$Date$"
revision: "$Revision$"
class
HELLO_EXECUTION
inherit
WSF_EXECUTION
create
make
feature -- Execution
execute
local
msg: WSF_PAGE_RESPONSE
do
create msg.make_with_body ("Hello World")
response.send (msg)
--| alternative would have been more low level
--| by setting the content type, and the content length which is 11 for "Hello World"
-- response.header.put_content_type_text_plain
-- response.header.put_content_length (11)
-- response.put_string ("Hello World")
end
end