Implemented WSF_RESPONSE.put_error (...) and related
Added WSF_RESPONSE.put_character Renamed WGI_OUTPUT_STREAM.put_character_8 as put_character to follow style of put_string (and not put_string_8) Refactored the WSF_DEFAULT_SERVICE_LAUNCHER Added WSF_DEFAULT_SERVICE to be more user friendly Splitted the wsf/default/ libraries to have wsf/connector/... and being able to handle more than one connector in the same application
This commit is contained in:
@@ -14,6 +14,8 @@ inherit
|
||||
|
||||
WSF_HANDLER_HELPER
|
||||
|
||||
WSF_DEFAULT_SERVICE
|
||||
|
||||
create
|
||||
make
|
||||
|
||||
@@ -24,9 +26,11 @@ feature {NONE} -- Initialization
|
||||
s: WSF_DEFAULT_SERVICE_LAUNCHER
|
||||
do
|
||||
initialize_router
|
||||
create s.make_and_launch_with_options (agent execute, <<["port", 9090]>>)
|
||||
set_service_option ("port", 9090)
|
||||
make_and_launch
|
||||
end
|
||||
|
||||
|
||||
create_router
|
||||
do
|
||||
create router.make (2)
|
||||
|
||||
@@ -6,19 +6,14 @@ note
|
||||
class
|
||||
APPLICATION
|
||||
|
||||
inherit
|
||||
WSF_DEFAULT_SERVICE
|
||||
|
||||
create
|
||||
make
|
||||
make_and_launch
|
||||
|
||||
feature {NONE} -- Initialization
|
||||
|
||||
make
|
||||
-- Run application.
|
||||
local
|
||||
s: WSF_DEFAULT_SERVICE_LAUNCHER
|
||||
do
|
||||
create s.make_and_launch (agent execute)
|
||||
end
|
||||
|
||||
execute (req: WSF_REQUEST; res: WSF_RESPONSE)
|
||||
do
|
||||
-- To send a response we need to setup, the status code and
|
||||
|
||||
@@ -1,20 +1,48 @@
|
||||
<?xml version="1.0" encoding="ISO-8859-1"?>
|
||||
<system xmlns="http://www.eiffel.com/developers/xml/configuration-1-9-0" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xsi:schemaLocation="http://www.eiffel.com/developers/xml/configuration-1-9-0 http://www.eiffel.com/developers/xml/configuration-1-9-0.xsd" name="simple" uuid="C28C4F53-9963-46C0-A080-8F13E94E7486">
|
||||
<target name="simple">
|
||||
<root class="APPLICATION" feature="make"/>
|
||||
|
||||
<target name="common" abstract="true">
|
||||
<file_rule>
|
||||
<exclude>/EIFGENs$</exclude>
|
||||
<exclude>/CVS$</exclude>
|
||||
<exclude>/.svn$</exclude>
|
||||
</file_rule>
|
||||
<option warning="true" is_attached_by_default="true" void_safety="all" syntax="transitional">
|
||||
<assertions precondition="true" postcondition="true" check="true" invariant="true" loop="true" supplier_precondition="true"/>
|
||||
</option>
|
||||
<library name="base" location="$ISE_LIBRARY\library\base\base-safe.ecf"/>
|
||||
<library name="default_nino" location="..\..\library\server\wsf\default\nino-safe.ecf"/>
|
||||
<library name="http" location="..\..\library\protocol\http\http-safe.ecf"/>
|
||||
<library name="wsf" location="..\..\library\server\wsf\wsf-safe.ecf"/>
|
||||
<cluster name="simple" location=".\" recursive="true">
|
||||
<file_rule>
|
||||
<exclude>/EIFGENs$</exclude>
|
||||
<exclude>/CVS$</exclude>
|
||||
<exclude>/.svn$</exclude>
|
||||
</file_rule>
|
||||
</cluster>
|
||||
</target>
|
||||
|
||||
<target name="simple_nino" extends="common">
|
||||
<root class="APPLICATION" feature="make_and_launch"/>
|
||||
<option warning="true" is_attached_by_default="true" void_safety="all" syntax="transitional">
|
||||
<assertions precondition="true" postcondition="true" check="true" invariant="true" loop="true" supplier_precondition="true"/>
|
||||
</option>
|
||||
<library name="default_nino" location="..\..\library\server\wsf\default\nino-safe.ecf"/>
|
||||
<cluster name="simple" location=".\" recursive="true"/>
|
||||
</target>
|
||||
|
||||
<target name="simple_cgi" extends="common">
|
||||
<root class="APPLICATION" feature="make_and_launch"/>
|
||||
<option warning="true" is_attached_by_default="true" void_safety="all" syntax="transitional">
|
||||
<assertions precondition="true" postcondition="true" check="true" invariant="true" loop="true" supplier_precondition="true"/>
|
||||
</option>
|
||||
<library name="default_cgi" location="..\..\library\server\wsf\default\cgi-safe.ecf"/>
|
||||
<cluster name="simple" location=".\" recursive="true"/>
|
||||
</target>
|
||||
|
||||
<target name="simple_libfcgi" extends="common">
|
||||
<root class="APPLICATION" feature="make_and_launch"/>
|
||||
<option warning="true" is_attached_by_default="true" void_safety="all" syntax="transitional">
|
||||
<assertions precondition="true" postcondition="true" check="true" invariant="true" loop="true" supplier_precondition="true"/>
|
||||
</option>
|
||||
<library name="default_libfcgi" location="..\..\library\server\wsf\default\libfcgi-safe.ecf"/>
|
||||
<cluster name="simple" location=".\" recursive="true"/>
|
||||
</target>
|
||||
|
||||
<target name="simple" extends="simple_nino">
|
||||
</target>
|
||||
|
||||
</system>
|
||||
|
||||
@@ -6,19 +6,14 @@ note
|
||||
class
|
||||
SERVICE_FILE
|
||||
|
||||
inherit
|
||||
WSF_DEFAULT_SERVICE
|
||||
|
||||
create
|
||||
make
|
||||
make_and_launch
|
||||
|
||||
feature {NONE} -- Initialization
|
||||
|
||||
make
|
||||
-- Run application.
|
||||
local
|
||||
s: WSF_DEFAULT_SERVICE_LAUNCHER
|
||||
do
|
||||
create s.make_and_launch (agent execute)
|
||||
end
|
||||
|
||||
execute (req: WSF_REQUEST; res: WSF_RESPONSE)
|
||||
local
|
||||
f: WSF_FILE_RESPONSE
|
||||
|
||||
@@ -1,7 +1,7 @@
|
||||
<?xml version="1.0" encoding="ISO-8859-1"?>
|
||||
<system xmlns="http://www.eiffel.com/developers/xml/configuration-1-9-0" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xsi:schemaLocation="http://www.eiffel.com/developers/xml/configuration-1-9-0 http://www.eiffel.com/developers/xml/configuration-1-9-0.xsd" name="service_file" uuid="C28C4F53-9963-46C0-A080-8F13E94E7486">
|
||||
<target name="service_file">
|
||||
<root class="SERVICE_FILE" feature="make"/>
|
||||
<root class="SERVICE_FILE" feature="make_and_launch"/>
|
||||
<option warning="true" is_attached_by_default="true" void_safety="all" syntax="transitional">
|
||||
<assertions precondition="true" postcondition="true" check="true" invariant="true" loop="true" supplier_precondition="true"/>
|
||||
</option>
|
||||
|
||||
@@ -12,6 +12,8 @@ inherit
|
||||
|
||||
WSF_URI_TEMPLATE_ROUTED_SERVICE
|
||||
|
||||
WSF_DEFAULT_SERVICE
|
||||
|
||||
create
|
||||
make
|
||||
|
||||
@@ -19,13 +21,14 @@ feature {NONE} -- Initialization
|
||||
|
||||
make
|
||||
-- Initialize Current
|
||||
local
|
||||
s: WSF_DEFAULT_SERVICE_LAUNCHER
|
||||
do
|
||||
initialize_router
|
||||
create s.make_and_launch (agent execute)
|
||||
-- Use the following line to use particular port number (as 9090) with Nino connector
|
||||
-- create s.make_and_launch_with_options (agent execute, <<["port", 9090]>>)
|
||||
|
||||
|
||||
-- To use particular port number (as 9090) with Nino connector
|
||||
-- Uncomment the following line
|
||||
-- set_service_option ("port", 9090)
|
||||
make_and_launch
|
||||
end
|
||||
|
||||
create_router
|
||||
@@ -126,7 +129,7 @@ feature -- Execution
|
||||
n := n - 1
|
||||
end
|
||||
l_body.append (" <input type=%"submit%" value=%"Upload%"/>%N</form>")
|
||||
page.send_to (res)
|
||||
res.send (page)
|
||||
else
|
||||
create l_body.make (255)
|
||||
l_body.append ("<h1>EWF: Uploaded files</h1>%N")
|
||||
@@ -154,7 +157,7 @@ feature -- Execution
|
||||
page.set_title ("EWF: uploaded image")
|
||||
page.add_style ("../style.css", "all")
|
||||
page.set_body (l_body)
|
||||
page.send_to (res)
|
||||
res.send (page)
|
||||
end
|
||||
end
|
||||
|
||||
|
||||
Reference in New Issue
Block a user