38 lines
709 B
Plaintext
38 lines
709 B
Plaintext
note
|
|
description : "Basic Service that Generates Plain Text"
|
|
date : "$Date$"
|
|
revision : "$Revision$"
|
|
|
|
class
|
|
APPLICATION
|
|
|
|
inherit
|
|
WSF_DEFAULT_SERVICE
|
|
redefine
|
|
initialize
|
|
end
|
|
|
|
create
|
|
make_and_launch
|
|
|
|
feature {NONE} -- Initialization
|
|
|
|
initialize
|
|
-- Initialize current service.
|
|
do
|
|
set_service_option ("port", 9090)
|
|
end
|
|
|
|
feature -- Basic operations
|
|
|
|
execute (req: WSF_REQUEST; res: WSF_RESPONSE)
|
|
-- Execute the incomming request
|
|
do
|
|
-- To send a response we need to setup, the status code and
|
|
-- the response headers.
|
|
res.put_header ({HTTP_STATUS_CODE}.ok, <<["Content-Type", "text/plain"], ["Content-Length", "11"]>>)
|
|
res.put_string ("Hello World")
|
|
end
|
|
|
|
end
|