From b976ea67308f25772eaa496588654753641fbfa0 Mon Sep 17 00:00:00 2001 From: inoussa Date: Fri, 22 Jul 2011 12:29:38 +0000 Subject: [PATCH] More specific doc for Apache module, rebuild sample git-svn-id: https://svn.code.sf.net/p/lazarus-ccr/svn@1754 8e941d3f-bd1b-0410-a28a-d453659cc2b4 --- wst/trunk/samples/apache_module/mod_wst.lpi | 177 +++++++++++------- .../apache_module/wst_apache_binding.pas | 18 +- .../user_client_console.lpi | 10 +- .../user_client_console.pas | 20 +- wst/trunk/samples/user_service_intf.pas | 4 +- .../samples/user_service_intf_binder.pas | 2 +- wst/trunk/samples/user_service_intf_proxy.pas | 2 +- 7 files changed, 152 insertions(+), 81 deletions(-) diff --git a/wst/trunk/samples/apache_module/mod_wst.lpi b/wst/trunk/samples/apache_module/mod_wst.lpi index 5dd77b099..aa70dc04e 100644 --- a/wst/trunk/samples/apache_module/mod_wst.lpi +++ b/wst/trunk/samples/apache_module/mod_wst.lpi @@ -1,19 +1,21 @@ + - - - + + + + @@ -26,28 +28,29 @@ - + - - - + + + + - + - - - + + + @@ -60,9 +63,12 @@ - - + + + + + @@ -408,134 +414,179 @@ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + - + - + - - + + - + - + - + - + - - + + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - - - - - - - - - - - - - - - - - - - - - - + + + + + + + + + + + + + + + + + + + + + + + + + + - + - - + + - + + + + + + diff --git a/wst/trunk/samples/apache_module/wst_apache_binding.pas b/wst/trunk/samples/apache_module/wst_apache_binding.pas index f571df6ed..8740268fd 100644 --- a/wst/trunk/samples/apache_module/wst_apache_binding.pas +++ b/wst/trunk/samples/apache_module/wst_apache_binding.pas @@ -1,7 +1,23 @@ //{$UNDEF WST_DBG} //{$DEFINE WST_DBG} -(*WST_BROKER enable the service brokering : +(* + Without the broker (WST_BROKER undefined): + Apache must be configured to route requests to wst services + + + SetHandler wst-handler + + + Services can then be invoked through the following addressing schema + http://127.0.0.1:8080/wst/services/UserService + + UserService : the target service + wst/services : constant. + + ============================================================================ + + WST_BROKER(still experimental !!!) enable the service brokering : if enabled, this module just forwards the request to the implementation libraries contained in the WstRootPath path. WST load these libraries in the local file system folder diff --git a/wst/trunk/samples/user_client_console/user_client_console.lpi b/wst/trunk/samples/user_client_console/user_client_console.lpi index fba768eb0..339002683 100644 --- a/wst/trunk/samples/user_client_console/user_client_console.lpi +++ b/wst/trunk/samples/user_client_console/user_client_console.lpi @@ -16,6 +16,9 @@ + + + @@ -27,11 +30,6 @@ - - - - - @@ -52,7 +50,7 @@ - + diff --git a/wst/trunk/samples/user_client_console/user_client_console.pas b/wst/trunk/samples/user_client_console/user_client_console.pas index d0f7f005d..5851e8a71 100644 --- a/wst/trunk/samples/user_client_console/user_client_console.pas +++ b/wst/trunk/samples/user_client_console/user_client_console.pas @@ -1,3 +1,5 @@ +{ $DEFINE USING_APACHE} //So it will adapt the service's address + program user_client_console; {$mode objfpc}{$H+} @@ -5,8 +7,8 @@ program user_client_console; uses Classes, SysUtils, TypInfo, {$IFDEF WINDOWS}ActiveX,{$ENDIF} user_service_intf_proxy, - same_process_protocol, synapse_tcp_protocol, synapse_http_protocol, library_protocol, -// same_process_protocol, indy_tcp_protocol, indy_http_protocol, library_protocol, + //same_process_protocol, synapse_tcp_protocol, synapse_http_protocol, library_protocol, + same_process_protocol, indy_tcp_protocol, indy_http_protocol, library_protocol, // same_process_protocol, ics_tcp_protocol, ics_http_protocol, library_protocol, soap_formatter, binary_formatter, json_formatter, user_service_intf, xmlrpc_formatter, service_intf; @@ -147,8 +149,12 @@ const ADDRESS_MAP : array[TTransportType] of string = ( //'LIB:FileName=C:\Programmes\D7\etatcivil\partages\wst\samples\library_server\lib_server.dll;target=UserService', //'TCP:Address=172.16.82.31;Port=1234;target=UserService', 'TCP:Address=127.0.0.1;Port=1234;target=UserService', - //'http:Address=http://127.0.0.1:8888/wst/services/lib_server/UserService' +{$IFDEF USING_APACHE} + 'http:Address=http://127.0.0.1:8080/wst/services/UserService' +{$ELSE USING_APACHE} 'http:Address=http://127.0.0.1:8000/services/UserService' +{$ENDIF USING_APACHE} + //'http:Address=http://127.0.0.1:8888/wst/services/lib_server/UserService' //'http:Address=http://127.0.0.1:8080/cgi-bin/demoservice.cgi/WST/%s/UserService/' ); FORMAT_MAP : array[TFormatType] of string =( 'binary', 'SOAP', 'xmlrpc', 'json', 'json' ); @@ -236,10 +242,10 @@ begin {$IF DECLARED(SetHeapTraceOutput)} SetHeapTraceOutput('heaptrace.txt'); {$IFEND} - SYNAPSE_RegisterTCP_Transport(); - SYNAPSE_RegisterHTTP_Transport(); -// INDY_RegisterTCP_Transport(); -// INDY_RegisterHTTP_Transport(); +// SYNAPSE_RegisterTCP_Transport(); +// SYNAPSE_RegisterHTTP_Transport(); + INDY_RegisterTCP_Transport(); + INDY_RegisterHTTP_Transport(); // ICS_RegisterTCP_Transport(); // ICS_RegisterHTTP_Transport(); LIB_Register_Transport(); diff --git a/wst/trunk/samples/user_service_intf.pas b/wst/trunk/samples/user_service_intf.pas index 595344209..bb9e996e5 100644 --- a/wst/trunk/samples/user_service_intf.pas +++ b/wst/trunk/samples/user_service_intf.pas @@ -2,7 +2,7 @@ This unit has been produced by ws_helper. Input unit name : "user_service_intf". This unit name : "user_service_intf". - Date : "29/01/2010 14:54:18". + Date : "22/07/2011 11:31:59". } unit user_service_intf; {$IFDEF FPC} @@ -68,7 +68,7 @@ type end; UserService = interface(IInvokable) - ['{2F9B181F-BA33-4148-A2A3-42CB450C43CE}'] + ['{1A6AE445-B888-41D1-BDC2-C3BE9C8F60D3}'] function GetList():TUserArray; procedure Add( const AUser : TUser diff --git a/wst/trunk/samples/user_service_intf_binder.pas b/wst/trunk/samples/user_service_intf_binder.pas index bf91a5d2e..ee4ce9dea 100644 --- a/wst/trunk/samples/user_service_intf_binder.pas +++ b/wst/trunk/samples/user_service_intf_binder.pas @@ -2,7 +2,7 @@ This unit has been produced by ws_helper. Input unit name : "user_service_intf". This unit name : "user_service_intf_binder". - Date : "29/01/2010 14:54:30". + Date : "22/07/2011 11:31:16". } unit user_service_intf_binder; {$IFDEF FPC} {$mode objfpc}{$H+} {$ENDIF} diff --git a/wst/trunk/samples/user_service_intf_proxy.pas b/wst/trunk/samples/user_service_intf_proxy.pas index 545895b80..94bff3444 100644 --- a/wst/trunk/samples/user_service_intf_proxy.pas +++ b/wst/trunk/samples/user_service_intf_proxy.pas @@ -2,7 +2,7 @@ This unit has been produced by ws_helper. Input unit name : "user_service_intf". This unit name : "user_service_intf_proxy". - Date : "29/01/2010 14:54:18". + Date : "22/07/2011 11:31:59". } Unit user_service_intf_proxy;