2006-08-26 00:35:42 +00:00
|
|
|
{
|
|
|
|
This file is part of the Web Service Toolkit
|
|
|
|
Copyright (c) 2006 by Inoussa OUEDRAOGO
|
|
|
|
|
|
|
|
This file is provide under modified LGPL licence
|
|
|
|
( the files COPYING.modifiedLGPL and COPYING.LGPL).
|
|
|
|
|
|
|
|
|
|
|
|
This program is distributed in the hope that it will be useful,
|
|
|
|
but WITHOUT ANY WARRANTY; without even the implied warranty of
|
|
|
|
MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.
|
|
|
|
}
|
2007-07-12 14:46:45 +00:00
|
|
|
{$INCLUDE wst_global.inc}
|
2006-08-26 00:35:42 +00:00
|
|
|
unit server_service_imputils;
|
|
|
|
|
|
|
|
interface
|
|
|
|
|
|
|
|
uses
|
|
|
|
Classes, SysUtils, TypInfo,
|
2008-09-25 02:24:25 +00:00
|
|
|
base_service_intf, server_service_intf;
|
2007-07-12 14:46:45 +00:00
|
|
|
|
2006-08-26 00:35:42 +00:00
|
|
|
Type
|
|
|
|
|
|
|
|
{ TRequestBuffer }
|
|
|
|
|
|
|
|
TRequestBuffer = class(TInterfacedObject,IRequestBuffer)
|
|
|
|
private
|
|
|
|
FTargetService : string;
|
|
|
|
FContentType : string;
|
2007-06-28 23:33:38 +00:00
|
|
|
FFormat : string;
|
2006-08-26 00:35:42 +00:00
|
|
|
FContent : TStream;
|
|
|
|
FResponse : TStream;
|
2008-09-25 02:24:25 +00:00
|
|
|
FPropertyManager : IPropertyManager;
|
2006-08-26 00:35:42 +00:00
|
|
|
protected
|
|
|
|
function GetTargetService():string;
|
|
|
|
function GetContentType():string;
|
|
|
|
//function GetLength():Integer;
|
|
|
|
function GetContent():TStream;
|
|
|
|
function GetResponse():TStream;
|
2007-06-28 23:33:38 +00:00
|
|
|
function GetFormat() : string;
|
2008-09-25 02:24:25 +00:00
|
|
|
function GetPropertyManager():IPropertyManager;
|
2006-08-26 00:35:42 +00:00
|
|
|
public
|
|
|
|
constructor Create(
|
2007-06-28 23:33:38 +00:00
|
|
|
const ATargetService : string;
|
|
|
|
const AContentType : string;
|
|
|
|
AContent : TStream;
|
|
|
|
AResponse : TStream;
|
|
|
|
AFormat : string
|
2006-08-26 00:35:42 +00:00
|
|
|
);
|
2007-06-28 23:33:38 +00:00
|
|
|
end;
|
2006-08-26 00:35:42 +00:00
|
|
|
|
|
|
|
|
2018-10-06 12:19:32 +00:00
|
|
|
function IsStrEmpty(Const AStr : RawByteString):Boolean;overload;
|
|
|
|
function IsStrEmpty(Const AStr : UnicodeString):Boolean;overload;
|
2006-08-26 00:35:42 +00:00
|
|
|
|
|
|
|
implementation
|
|
|
|
|
2018-10-06 12:19:32 +00:00
|
|
|
function IsStrEmpty(Const AStr : RawByteString):Boolean;
|
|
|
|
begin
|
|
|
|
Result := ( Length(Trim(AStr)) = 0 );
|
|
|
|
end;
|
|
|
|
|
|
|
|
function IsStrEmpty(Const AStr : UnicodeString):Boolean;
|
2006-08-26 00:35:42 +00:00
|
|
|
begin
|
|
|
|
Result := ( Length(Trim(AStr)) = 0 );
|
|
|
|
end;
|
|
|
|
|
|
|
|
{ TRequestBuffer }
|
|
|
|
|
|
|
|
function TRequestBuffer.GetTargetService(): string;
|
|
|
|
begin
|
|
|
|
Result := FTargetService;
|
|
|
|
end;
|
|
|
|
|
|
|
|
function TRequestBuffer.GetContentType(): string;
|
|
|
|
begin
|
|
|
|
Result := FContentType;
|
|
|
|
end;
|
|
|
|
|
|
|
|
{function TRequestBuffer.GetLength(): Integer;
|
|
|
|
begin
|
|
|
|
Result := FLength;
|
|
|
|
end;}
|
|
|
|
|
|
|
|
function TRequestBuffer.GetContent(): TStream;
|
|
|
|
begin
|
|
|
|
Result := FContent;
|
|
|
|
end;
|
|
|
|
|
|
|
|
function TRequestBuffer.GetResponse(): TStream;
|
|
|
|
begin
|
|
|
|
Result := FResponse;
|
|
|
|
end;
|
|
|
|
|
2007-06-28 23:33:38 +00:00
|
|
|
function TRequestBuffer.GetFormat(): string;
|
|
|
|
begin
|
|
|
|
Result := FFormat;
|
|
|
|
end;
|
|
|
|
|
2008-09-25 02:24:25 +00:00
|
|
|
function TRequestBuffer.GetPropertyManager(): IPropertyManager;
|
|
|
|
begin
|
|
|
|
Result := FPropertyManager;
|
|
|
|
end;
|
|
|
|
|
2006-08-26 00:35:42 +00:00
|
|
|
constructor TRequestBuffer.Create(
|
2007-06-28 23:33:38 +00:00
|
|
|
const ATargetService : string;
|
|
|
|
const AContentType : string;
|
|
|
|
AContent : TStream;
|
|
|
|
AResponse : TStream;
|
|
|
|
AFormat : string
|
2006-08-26 00:35:42 +00:00
|
|
|
);
|
|
|
|
begin
|
|
|
|
FTargetService := ATargetService;
|
|
|
|
FContentType := AContentType;
|
2007-06-28 23:33:38 +00:00
|
|
|
FFormat := AFormat;
|
2006-08-26 00:35:42 +00:00
|
|
|
FContent := AContent;
|
|
|
|
FResponse := AResponse;
|
2015-01-19 09:31:59 +00:00
|
|
|
FPropertyManager := TStoredPropertyManager.Create();
|
2006-08-26 00:35:42 +00:00
|
|
|
end;
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
end.
|