diff --git a/wst/trunk/base_service_intf.pas b/wst/trunk/base_service_intf.pas index 18a5bc406..c613e1bd3 100644 --- a/wst/trunk/base_service_intf.pas +++ b/wst/trunk/base_service_intf.pas @@ -127,6 +127,7 @@ type function GetHeaderCount(const ADirections : THeaderDirections):Integer; function GetHeader(const AIndex : Integer) : THeaderBlock; procedure ClearHeaders(const ADirection : THeaderDirection); + function GetPropertyManager():IPropertyManager; End; TSerializationStyle = ( ssNodeSerialization, ssAttibuteSerialization ); @@ -220,6 +221,7 @@ type private FHeaderList : TObjectList; FFreeObjectList : TObjectList; + FPropertyManager : IPropertyManager; protected procedure AddObjectToFree(const AObject : TObject); procedure Clear(); @@ -231,10 +233,11 @@ type function GetHeader(const AIndex : Integer) : THeaderBlock; procedure ClearHeaders(const ADirection : THeaderDirection); procedure FreeHeader(AHeader : THeaderBlock); - Public + function GetPropertyManager():IPropertyManager; + public constructor Create(); destructor Destroy();override; - End; + end; { TBaseRemotable } TBaseRemotableClass = class of TBaseRemotable; @@ -2752,10 +2755,16 @@ begin end; end; +function TSimpleCallContext.GetPropertyManager(): IPropertyManager; +begin + Result := FPropertyManager; +end; + constructor TSimpleCallContext.Create(); begin FHeaderList := TObjectList.Create(False); FFreeObjectList := TObjectList.Create(True); + FPropertyManager := TStoredPropertyManager.Create() as IPropertyManager; end; destructor TSimpleCallContext.Destroy(); diff --git a/wst/trunk/indy_http_server.pas b/wst/trunk/indy_http_server.pas index 63406b335..141a8b620 100644 --- a/wst/trunk/indy_http_server.pas +++ b/wst/trunk/indy_http_server.pas @@ -37,9 +37,6 @@ uses IdSocketHandle, server_listener; -{$INCLUDE wst.inc} -{$INCLUDE wst_delphi.inc} - type { TwstIndyHttpListener } @@ -190,6 +187,7 @@ begin AResponseInfo.ContentType := ctntyp; frmt := Trim(ARequestInfo.Params.Values['format']); rqst := TRequestBuffer.Create(trgt,ctntyp,inStream,AResponseInfo.ContentStream,frmt); + rqst.GetPropertyManager().SetProperty(sREMOTE_IP,ARequestInfo.RemoteIP); HandleServiceRequest(rqst); finally inStream.Free(); diff --git a/wst/trunk/indy_tcp_server.pas b/wst/trunk/indy_tcp_server.pas index ff5f4c65f..f473d00ec 100644 --- a/wst/trunk/indy_tcp_server.pas +++ b/wst/trunk/indy_tcp_server.pas @@ -168,6 +168,8 @@ begin locInStream.Write(buff[1],Length(buff)); locInStream.Position := 0; rqst := TRequestBuffer.Create(trgt,ctntyp,locInStream,locOutStream,frmt); + rqst.GetPropertyManager().SetProperty(sREMOTE_IP,AContext.Binding.PeerIP); + rqst.GetPropertyManager().SetProperty(sREMOTE_PORT,IntToStr(AContext.Binding.PeerPort)); HandleServiceRequest(rqst); i := locOutStream.Size; SetLength(buff,i); diff --git a/wst/trunk/server_service_imputils.pas b/wst/trunk/server_service_imputils.pas index 62acb247f..c8a65ed2b 100644 --- a/wst/trunk/server_service_imputils.pas +++ b/wst/trunk/server_service_imputils.pas @@ -17,11 +17,8 @@ interface uses Classes, SysUtils, TypInfo, - server_service_intf; + base_service_intf, server_service_intf; -{$INCLUDE wst.inc} -{$INCLUDE wst_delphi.inc} - Type { TRequestBuffer } @@ -33,6 +30,7 @@ Type FFormat : string; FContent : TStream; FResponse : TStream; + FPropertyManager : IPropertyManager; protected function GetTargetService():string; function GetContentType():string; @@ -40,6 +38,7 @@ Type function GetContent():TStream; function GetResponse():TStream; function GetFormat() : string; + function GetPropertyManager():IPropertyManager; public constructor Create( const ATargetService : string; @@ -92,6 +91,11 @@ begin Result := FFormat; end; +function TRequestBuffer.GetPropertyManager(): IPropertyManager; +begin + Result := FPropertyManager; +end; + constructor TRequestBuffer.Create( const ATargetService : string; const AContentType : string; @@ -105,6 +109,7 @@ begin FFormat := AFormat; FContent := AContent; FResponse := AResponse; + FPropertyManager := TStoredPropertyManager.Create() as IPropertyManager; end; diff --git a/wst/trunk/server_service_intf.pas b/wst/trunk/server_service_intf.pas index 76be5b939..b41996a29 100644 --- a/wst/trunk/server_service_intf.pas +++ b/wst/trunk/server_service_intf.pas @@ -19,10 +19,11 @@ uses Classes, SysUtils, TypInfo, Contnrs, base_service_intf; -{$INCLUDE wst.inc} -{$INCLUDE wst_delphi.inc} - -Type +const + sREMOTE_IP = 'RemoteIP'; + sREMOTE_PORT = 'RemotePort'; + +type IRequestBuffer = interface; IServerService = interface; @@ -49,6 +50,7 @@ Type function GetContent():TStream; function GetResponse():TStream; function GetFormat() : string; + function GetPropertyManager():IPropertyManager; end; IServerService = Interface @@ -480,6 +482,7 @@ begin Error('No formatter for that content type : "%s"',[s]); try cllCtx := CreateCallContext(); + cllCtx.GetPropertyManager().Copy(ARequestBuffer.GetPropertyManager(),False); DoProcessMessage(msBeforeDeserialize,cllCtx,ARequestBuffer); strm := ARequestBuffer.GetContent(); f.LoadFromStream(strm); diff --git a/wst/trunk/service_intf.pas b/wst/trunk/service_intf.pas index 6d3d4acc0..61317e22a 100644 --- a/wst/trunk/service_intf.pas +++ b/wst/trunk/service_intf.pas @@ -104,6 +104,7 @@ Type function GetHeader(const AIndex : Integer) : THeaderBlock; // ---- END >> ICallContext implementation ---- procedure ClearHeaders(const ADirection : THeaderDirection); + function GetPropertyManager():IPropertyManager; public (* This is the primary constructor! *) constructor Create( @@ -281,6 +282,11 @@ begin FCallContext.ClearHeaders(ADirection); end; +function TBaseProxy.GetPropertyManager(): IPropertyManager; +begin + Result := FCallContext.GetPropertyManager(); +end; + constructor TBaseProxy.Create( const ATarget : String; const AProtocol : IServiceProtocol diff --git a/wst/trunk/synapse_tcp_server.pas b/wst/trunk/synapse_tcp_server.pas index 3e0ada4b7..bbdcc7c05 100644 --- a/wst/trunk/synapse_tcp_server.pas +++ b/wst/trunk/synapse_tcp_server.pas @@ -202,6 +202,8 @@ begin FInputStream.Write(buff[1],Length(buff)); FInputStream.Position := 0; rqst := TRequestBuffer.Create(trgt,ctntyp,FInputStream,FOutputStream,frmt); + rqst.GetPropertyManager().SetProperty(sREMOTE_IP,FSocketObject.GetRemoteSinIP()); + rqst.GetPropertyManager().SetProperty(sREMOTE_PORT,IntToStr(FSocketObject.GetRemoteSinPort())); HandleServiceRequest(rqst); i := FOutputStream.Size; SetLength(buff,i); diff --git a/wst/trunk/ws_helper/delphi/ws_helper.cfg b/wst/trunk/ws_helper/delphi/ws_helper.cfg index e122280e5..bfa13e5df 100644 --- a/wst/trunk/ws_helper/delphi/ws_helper.cfg +++ b/wst/trunk/ws_helper/delphi/ws_helper.cfg @@ -38,6 +38,7 @@ -O"..\;..\..\;..\..\fcl-units\fcl-passrc\src;..\..\fcl-units\rtl\inc;..\..\wst_rtti_filter" -I"..\;..\..\;..\..\fcl-units\fcl-passrc\src;..\..\fcl-units\rtl\inc;..\..\wst_rtti_filter" -R"..\;..\..\;..\..\fcl-units\fcl-passrc\src;..\..\fcl-units\rtl\inc;..\..\wst_rtti_filter" +-DWST_HANDLE_DOC -w-UNSAFE_TYPE -w-UNSAFE_CODE -w-UNSAFE_CAST diff --git a/wst/trunk/ws_helper/delphi/ws_helper.dof b/wst/trunk/ws_helper/delphi/ws_helper.dof index b5488a7c1..913411d89 100644 --- a/wst/trunk/ws_helper/delphi/ws_helper.dof +++ b/wst/trunk/ws_helper/delphi/ws_helper.dof @@ -96,7 +96,7 @@ PackageDLLOutputDir= PackageDCPOutputDir= SearchPath=..\;..\..\;..\..\fcl-units\fcl-passrc\src;..\..\fcl-units\rtl\inc;..\..\wst_rtti_filter Packages=vcl;rtl;vclx;indy;inet;xmlrtl;vclie;inetdbbde;inetdbxpress;dbrtl;dsnap;dsnapcon;vcldb;soaprtl;VclSmp;dbexpress;dbxcds;inetdb;bdertl;vcldbx;webdsnap;websnap;adortl;ibxpress;teeui;teedb;tee;dss;visualclx;visualdbclx;vclactnband;vclshlctrls;IntrawebDB_50_70;Intraweb_50_70;Rave50CLX;Rave50VCL;dclOfficeXP;FIBDBMidas7;Jcl;JclVcl;JvCoreD7R;JvSystemD7R;JvStdCtrlsD7R;JvAppFrmD7R;JvBandsD7R;JvDBD7R;JvDlgsD7R;JvBDED7R;JvCmpD7R;JvCryptD7R;JvCtrlsD7R;JvCustomD7R;JvDockingD7R;JvDotNetCtrlsD7R;JvEDID7R;JvGlobusD7R;JvHMID7R;JvInterpreterD7R;JvJansD7R;JvManagedThreadsD7R;JvMMD7R;JvNetD7R;JvPageCompsD7R;JvPluginD7R;JvPrintPreviewD7R;JvRuntimeDesignD7R;JvTimeFrameworkD7R;JvUIBD7R;JvValidatorsD7R;JvWizardD7R;JvXPCtrlsD7R;dxForumLibD7;cxLibraryVCLD7;cxPageControlVCLD7;dxBarD7;dxComnD7;dxBarDBNavD7;dxBarExtItemsD7;dxBarExtDBItemsD7;dxsbD7;dxmdsD7;dxdbtrD7;dxtrmdD7;dxorgcD7;dxdborD7;dxEdtrD7;EQTLD7;ECQDBCD7;EQDBTLD7;EQGridD7;dxGrEdD7;dxExELD7;dxELibD7;cxEditorsVCLD7;cxGridVCLD7;dxThemeD7;cxDataD7;cxGridUtilsVCLD7;dxPSCoreD7;dxPsPrVwAdvD7;dxPSLnksD7;dxPSTeeChartD7;dxPSDBTeeChartD7;dxPSdxDBTVLnkD7;dxPSdxOCLnkD7;dxPSdxDBOCLnkD7;dxPScxGridLnkD7;dxPSTLLnkD7;qrpt -Conditionals= +Conditionals=WST_HANDLE_DOC DebugSourceDirs=C:\Programmes\lazarus\wst\trunk\fcl-units\rtl\;C:\Programmes\lazarus\wst\trunk\;C:\Programmes\lazarus\wst\trunk\fcl-units\fcl-passrc\src\ UsePackages=0 [Parameters] @@ -134,17 +134,12 @@ OriginalFilename= ProductName= ProductVersion=1.0.0.0 Comments= -[Excluded Packages] -C:\Program Files\Developer Express Inc\ExpressPrinting System\Delphi 7\Lib\dxPSdxDBTLLnkD7.bpl=ExpressPrinting System ReportLink for ExpressQuantumDBTreeList by Developer Express Inc. -C:\Program Files\Developer Express Inc\ExpressPrinting System\Delphi 7\Lib\dxPSdxDBGrLnkD7.bpl=ExpressPrinting System ReportLink for ExpressQuantumGrid by Developer Express Inc. -C:\Program Files\Developer Express Inc\ExpressPrinting System\Delphi 7\Lib\dxPSdxInsLnkD7.bpl=ExpressPrinting System ReportLink for ExpressInspector by Developer Express Inc. -C:\Program Files\Developer Express Inc\ExpressPrinting System\Delphi 7\Lib\dxPSdxOILnkD7.bpl=ExpressPrinting System ReportLink for ExpressRTTIInspector by Developer Express Inc. -C:\Program Files\Developer Express Inc\ExpressPrinting System\Delphi 7\Lib\dxPSdxMVLnkD7.bpl=ExpressPrinting System ReportLink for ExpressMasterView by Developer Express Inc. -C:\Program Files\Developer Express Inc\ExpressPrinting System\Delphi 7\Lib\dxPSdxFCLnkD7.bpl=ExpressPrinting System ReportLinks for ExpressFlowChart by Developer Express Inc. -C:\Program Files\Developer Express Inc\ExpressPrinting System\Delphi 7\Lib\dxPScxSSLnkD7.bpl=ExpressPrinting System ReportLink for ExpressSpreadSheet by Developer Express Inc. [HistoryLists\hlDebugSourcePath] Count=1 Item0=C:\Programmes\lazarus\wst\trunk\fcl-units\rtl\;C:\Programmes\lazarus\wst\trunk\;C:\Programmes\lazarus\wst\trunk\fcl-units\fcl-passrc\src\ +[HistoryLists\hlConditionals] +Count=1 +Item0=WST_HANDLE_DOC [HistoryLists\hlUnitAliases] Count=1 Item0=WinTypes=Windows;WinProcs=Windows;DbiTypes=BDE;DbiProcs=BDE;DbiErrs=BDE;