You've already forked lazarus-ccr
Fix for sample: WST now defaults to UnicodeStrings.
git-svn-id: https://svn.code.sf.net/p/lazarus-ccr/svn@5953 8e941d3f-bd1b-0410-a28a-d453659cc2b4
This commit is contained in:
@@ -2,15 +2,13 @@
|
|||||||
This unit has been produced by ws_helper.
|
This unit has been produced by ws_helper.
|
||||||
Input unit name : "user_service_intf".
|
Input unit name : "user_service_intf".
|
||||||
This unit name : "user_service_intf".
|
This unit name : "user_service_intf".
|
||||||
Date : "22/07/2011 11:31:59".
|
Date : "22/06/2017 15:02:26".
|
||||||
}
|
}
|
||||||
unit user_service_intf;
|
unit user_service_intf;
|
||||||
{$IFDEF FPC}
|
{$IFDEF FPC}
|
||||||
{$mode objfpc} {$H+}
|
{$mode objfpc} {$H+}
|
||||||
{$ENDIF}
|
{$ENDIF}
|
||||||
{$IFNDEF FPC}
|
{$DEFINE WST_RECORD_RTTI}
|
||||||
{$DEFINE WST_RECORD_RTTI}
|
|
||||||
{$ENDIF}
|
|
||||||
interface
|
interface
|
||||||
|
|
||||||
uses SysUtils, Classes, TypInfo, base_service_intf, service_intf;
|
uses SysUtils, Classes, TypInfo, base_service_intf, service_intf;
|
||||||
@@ -33,30 +31,30 @@ type
|
|||||||
TUser = class(TBaseComplexRemotable)
|
TUser = class(TBaseComplexRemotable)
|
||||||
private
|
private
|
||||||
FCategory : TUserCategory;
|
FCategory : TUserCategory;
|
||||||
FUserName : string;
|
FUserName : UnicodeString;
|
||||||
FeMail : string;
|
FeMail : UnicodeString;
|
||||||
FPreferences : string;
|
FPreferences : UnicodeString;
|
||||||
FNote : TNote;
|
FNote : TNote;
|
||||||
public
|
public
|
||||||
constructor Create();override;
|
constructor Create();override;
|
||||||
procedure FreeObjectProperties();override;
|
procedure FreeObjectProperties();override;
|
||||||
published
|
published
|
||||||
property Category : TUserCategory read FCategory write FCategory;
|
property Category : TUserCategory read FCategory write FCategory;
|
||||||
property UserName : string read FUserName write FUserName;
|
property UserName : UnicodeString read FUserName write FUserName;
|
||||||
property eMail : string read FeMail write FeMail;
|
property eMail : UnicodeString read FeMail write FeMail;
|
||||||
property Preferences : string read FPreferences write FPreferences;
|
property Preferences : UnicodeString read FPreferences write FPreferences;
|
||||||
property Note : TNote read FNote write FNote;
|
property Note : TNote read FNote write FNote;
|
||||||
end;
|
end;
|
||||||
|
|
||||||
TNote = class(TBaseComplexRemotable)
|
TNote = class(TBaseComplexRemotable)
|
||||||
private
|
private
|
||||||
FHeader : string;
|
FHeader : UnicodeString;
|
||||||
FAuthor : string;
|
FAuthor : UnicodeString;
|
||||||
FDate : string;
|
FDate : UnicodeString;
|
||||||
published
|
published
|
||||||
property Header : string read FHeader write FHeader;
|
property Header : UnicodeString read FHeader write FHeader;
|
||||||
property Author : string read FAuthor write FAuthor;
|
property Author : UnicodeString read FAuthor write FAuthor;
|
||||||
property Date : string read FDate write FDate;
|
property Date : UnicodeString read FDate write FDate;
|
||||||
end;
|
end;
|
||||||
|
|
||||||
TUserArray = class(TBaseObjectArrayRemotable)
|
TUserArray = class(TBaseObjectArrayRemotable)
|
||||||
@@ -68,7 +66,7 @@ type
|
|||||||
end;
|
end;
|
||||||
|
|
||||||
UserService = interface(IInvokable)
|
UserService = interface(IInvokable)
|
||||||
['{1A6AE445-B888-41D1-BDC2-C3BE9C8F60D3}']
|
['{D039952C-BE65-4C35-85FD-092038A8B25D}']
|
||||||
function GetList():TUserArray;
|
function GetList():TUserArray;
|
||||||
procedure Add(
|
procedure Add(
|
||||||
const AUser : TUser
|
const AUser : TUser
|
||||||
@@ -77,10 +75,10 @@ type
|
|||||||
const AUser : TUser
|
const AUser : TUser
|
||||||
);
|
);
|
||||||
function Find(
|
function Find(
|
||||||
const AName : string
|
const AName : UnicodeString
|
||||||
):TUser;
|
):TUser;
|
||||||
function Delete(
|
function Delete(
|
||||||
const AName : string
|
const AName : UnicodeString
|
||||||
):boolean;
|
):boolean;
|
||||||
end;
|
end;
|
||||||
|
|
||||||
|
@@ -2,7 +2,7 @@
|
|||||||
This unit has been produced by ws_helper.
|
This unit has been produced by ws_helper.
|
||||||
Input unit name : "user_service_intf".
|
Input unit name : "user_service_intf".
|
||||||
This unit name : "user_service_intf_binder".
|
This unit name : "user_service_intf_binder".
|
||||||
Date : "22/07/2011 11:31:16".
|
Date : "22/06/2017 15:01:59".
|
||||||
}
|
}
|
||||||
unit user_service_intf_binder;
|
unit user_service_intf_binder;
|
||||||
{$IFDEF FPC} {$mode objfpc}{$H+} {$ENDIF}
|
{$IFDEF FPC} {$mode objfpc}{$H+} {$ENDIF}
|
||||||
@@ -52,7 +52,7 @@ var
|
|||||||
returnVal : TUserArray;
|
returnVal : TUserArray;
|
||||||
begin
|
begin
|
||||||
callCtx := AContext;
|
callCtx := AContext;
|
||||||
Fillchar(returnVal,SizeOf(TUserArray),#0);
|
returnVal := nil;
|
||||||
|
|
||||||
|
|
||||||
tmpObj := Self.GetFactory().CreateInstance() as UserService;
|
tmpObj := Self.GetFactory().CreateInstance() as UserService;
|
||||||
@@ -63,8 +63,8 @@ begin
|
|||||||
objCntrl.Activate();
|
objCntrl.Activate();
|
||||||
try
|
try
|
||||||
returnVal := tmpObj.GetList();
|
returnVal := tmpObj.GetList();
|
||||||
if Assigned(TObject(returnVal)) then
|
if (returnVal <> nil) then
|
||||||
callCtx.AddObjectToFree(TObject(returnVal));
|
callCtx.AddObjectToFree(returnVal);
|
||||||
|
|
||||||
procName := AFormatter.GetCallProcedureName();
|
procName := AFormatter.GetCallProcedureName();
|
||||||
trgName := AFormatter.GetCallTarget();
|
trgName := AFormatter.GetCallTarget();
|
||||||
@@ -93,11 +93,11 @@ var
|
|||||||
AUser : TUser;
|
AUser : TUser;
|
||||||
begin
|
begin
|
||||||
callCtx := AContext;
|
callCtx := AContext;
|
||||||
Fillchar(AUser,SizeOf(TUser),#0);
|
AUser := nil;
|
||||||
|
|
||||||
locStrPrmName := 'AUser'; AFormatter.Get(TypeInfo(TUser),locStrPrmName,AUser);
|
locStrPrmName := 'AUser'; AFormatter.Get(TypeInfo(TUser),locStrPrmName,AUser);
|
||||||
if Assigned(Pointer(AUser)) then
|
if (AUser <> nil) then
|
||||||
callCtx.AddObjectToFree(TObject(AUser));
|
callCtx.AddObjectToFree(AUser);
|
||||||
|
|
||||||
tmpObj := Self.GetFactory().CreateInstance() as UserService;
|
tmpObj := Self.GetFactory().CreateInstance() as UserService;
|
||||||
if Supports(tmpObj,ICallControl,cllCntrl) then
|
if Supports(tmpObj,ICallControl,cllCntrl) then
|
||||||
@@ -134,11 +134,11 @@ var
|
|||||||
AUser : TUser;
|
AUser : TUser;
|
||||||
begin
|
begin
|
||||||
callCtx := AContext;
|
callCtx := AContext;
|
||||||
Fillchar(AUser,SizeOf(TUser),#0);
|
AUser := nil;
|
||||||
|
|
||||||
locStrPrmName := 'AUser'; AFormatter.Get(TypeInfo(TUser),locStrPrmName,AUser);
|
locStrPrmName := 'AUser'; AFormatter.Get(TypeInfo(TUser),locStrPrmName,AUser);
|
||||||
if Assigned(Pointer(AUser)) then
|
if (AUser <> nil) then
|
||||||
callCtx.AddObjectToFree(TObject(AUser));
|
callCtx.AddObjectToFree(AUser);
|
||||||
|
|
||||||
tmpObj := Self.GetFactory().CreateInstance() as UserService;
|
tmpObj := Self.GetFactory().CreateInstance() as UserService;
|
||||||
if Supports(tmpObj,ICallControl,cllCntrl) then
|
if Supports(tmpObj,ICallControl,cllCntrl) then
|
||||||
@@ -172,13 +172,13 @@ var
|
|||||||
callCtx : ICallContext;
|
callCtx : ICallContext;
|
||||||
locStrPrmName : string;
|
locStrPrmName : string;
|
||||||
procName,trgName : string;
|
procName,trgName : string;
|
||||||
AName : string;
|
AName : UnicodeString;
|
||||||
returnVal : TUser;
|
returnVal : TUser;
|
||||||
begin
|
begin
|
||||||
callCtx := AContext;
|
callCtx := AContext;
|
||||||
Fillchar(returnVal,SizeOf(TUser),#0);
|
returnVal := nil;
|
||||||
|
|
||||||
locStrPrmName := 'AName'; AFormatter.Get(TypeInfo(string),locStrPrmName,AName);
|
locStrPrmName := 'AName'; AFormatter.Get(TypeInfo(UnicodeString),locStrPrmName,AName);
|
||||||
|
|
||||||
tmpObj := Self.GetFactory().CreateInstance() as UserService;
|
tmpObj := Self.GetFactory().CreateInstance() as UserService;
|
||||||
if Supports(tmpObj,ICallControl,cllCntrl) then
|
if Supports(tmpObj,ICallControl,cllCntrl) then
|
||||||
@@ -188,8 +188,8 @@ begin
|
|||||||
objCntrl.Activate();
|
objCntrl.Activate();
|
||||||
try
|
try
|
||||||
returnVal := tmpObj.Find(AName);
|
returnVal := tmpObj.Find(AName);
|
||||||
if Assigned(TObject(returnVal)) then
|
if (returnVal <> nil) then
|
||||||
callCtx.AddObjectToFree(TObject(returnVal));
|
callCtx.AddObjectToFree(returnVal);
|
||||||
|
|
||||||
procName := AFormatter.GetCallProcedureName();
|
procName := AFormatter.GetCallProcedureName();
|
||||||
trgName := AFormatter.GetCallTarget();
|
trgName := AFormatter.GetCallTarget();
|
||||||
@@ -215,12 +215,12 @@ var
|
|||||||
callCtx : ICallContext;
|
callCtx : ICallContext;
|
||||||
locStrPrmName : string;
|
locStrPrmName : string;
|
||||||
procName,trgName : string;
|
procName,trgName : string;
|
||||||
AName : string;
|
AName : UnicodeString;
|
||||||
returnVal : boolean;
|
returnVal : boolean;
|
||||||
begin
|
begin
|
||||||
callCtx := AContext;
|
callCtx := AContext;
|
||||||
|
|
||||||
locStrPrmName := 'AName'; AFormatter.Get(TypeInfo(string),locStrPrmName,AName);
|
locStrPrmName := 'AName'; AFormatter.Get(TypeInfo(UnicodeString),locStrPrmName,AName);
|
||||||
|
|
||||||
tmpObj := Self.GetFactory().CreateInstance() as UserService;
|
tmpObj := Self.GetFactory().CreateInstance() as UserService;
|
||||||
if Supports(tmpObj,ICallControl,cllCntrl) then
|
if Supports(tmpObj,ICallControl,cllCntrl) then
|
||||||
|
@@ -5,7 +5,10 @@ This unit has been produced by ws_helper.
|
|||||||
Date : "30/04/2007 00:07".
|
Date : "30/04/2007 00:07".
|
||||||
}
|
}
|
||||||
Unit user_service_intf_imp;
|
Unit user_service_intf_imp;
|
||||||
{$IFDEF FPC} {$mode objfpc}{$H+} {$ENDIF}
|
{$IFDEF FPC}
|
||||||
|
{$mode objfpc}{$H+}
|
||||||
|
{$modeswitch UNICODESTRINGS}
|
||||||
|
{$ENDIF}
|
||||||
Interface
|
Interface
|
||||||
|
|
||||||
Uses SysUtils, Classes,
|
Uses SysUtils, Classes,
|
||||||
|
@@ -2,7 +2,7 @@
|
|||||||
This unit has been produced by ws_helper.
|
This unit has been produced by ws_helper.
|
||||||
Input unit name : "user_service_intf".
|
Input unit name : "user_service_intf".
|
||||||
This unit name : "user_service_intf_proxy".
|
This unit name : "user_service_intf_proxy".
|
||||||
Date : "22/07/2011 11:31:59".
|
Date : "22/06/2017 15:02:26".
|
||||||
}
|
}
|
||||||
|
|
||||||
Unit user_service_intf_proxy;
|
Unit user_service_intf_proxy;
|
||||||
@@ -14,7 +14,7 @@ Uses SysUtils, Classes, TypInfo, base_service_intf, service_intf, user_service_i
|
|||||||
Type
|
Type
|
||||||
|
|
||||||
|
|
||||||
TUserService_Proxy=class(TBaseProxy,UserService)
|
TUserService_Proxy=class(TBaseProxy,user_service_intf.UserService)
|
||||||
Protected
|
Protected
|
||||||
class function GetServiceType() : PTypeInfo;override;
|
class function GetServiceType() : PTypeInfo;override;
|
||||||
function GetList():TUserArray;
|
function GetList():TUserArray;
|
||||||
@@ -25,10 +25,10 @@ Type
|
|||||||
const AUser : TUser
|
const AUser : TUser
|
||||||
);
|
);
|
||||||
function Find(
|
function Find(
|
||||||
const AName : string
|
const AName : UnicodeString
|
||||||
):TUser;
|
):TUser;
|
||||||
function Delete(
|
function Delete(
|
||||||
const AName : string
|
const AName : UnicodeString
|
||||||
):boolean;
|
):boolean;
|
||||||
End;
|
End;
|
||||||
|
|
||||||
@@ -52,7 +52,7 @@ End;
|
|||||||
|
|
||||||
class function TUserService_Proxy.GetServiceType() : PTypeInfo;
|
class function TUserService_Proxy.GetServiceType() : PTypeInfo;
|
||||||
begin
|
begin
|
||||||
result := TypeInfo(UserService);
|
result := TypeInfo(user_service_intf.UserService);
|
||||||
end;
|
end;
|
||||||
|
|
||||||
function TUserService_Proxy.GetList():TUserArray;
|
function TUserService_Proxy.GetList():TUserArray;
|
||||||
@@ -70,7 +70,7 @@ Begin
|
|||||||
MakeCall();
|
MakeCall();
|
||||||
|
|
||||||
locSerializer.BeginCallRead(locCallContext);
|
locSerializer.BeginCallRead(locCallContext);
|
||||||
TObject(Result) := Nil;
|
Result := Nil;
|
||||||
locStrPrmName := 'result';
|
locStrPrmName := 'result';
|
||||||
locSerializer.Get(TypeInfo(TUserArray), locStrPrmName, Result);
|
locSerializer.Get(TypeInfo(TUserArray), locStrPrmName, Result);
|
||||||
|
|
||||||
@@ -128,7 +128,7 @@ Begin
|
|||||||
End;
|
End;
|
||||||
|
|
||||||
function TUserService_Proxy.Find(
|
function TUserService_Proxy.Find(
|
||||||
const AName : string
|
const AName : UnicodeString
|
||||||
):TUser;
|
):TUser;
|
||||||
Var
|
Var
|
||||||
locSerializer : IFormatterClient;
|
locSerializer : IFormatterClient;
|
||||||
@@ -139,13 +139,13 @@ Begin
|
|||||||
locSerializer := GetSerializer();
|
locSerializer := GetSerializer();
|
||||||
Try
|
Try
|
||||||
locSerializer.BeginCall('Find', GetTarget(),locCallContext);
|
locSerializer.BeginCall('Find', GetTarget(),locCallContext);
|
||||||
locSerializer.Put('AName', TypeInfo(string), AName);
|
locSerializer.Put('AName', TypeInfo(UnicodeString), AName);
|
||||||
locSerializer.EndCall();
|
locSerializer.EndCall();
|
||||||
|
|
||||||
MakeCall();
|
MakeCall();
|
||||||
|
|
||||||
locSerializer.BeginCallRead(locCallContext);
|
locSerializer.BeginCallRead(locCallContext);
|
||||||
TObject(Result) := Nil;
|
Result := Nil;
|
||||||
locStrPrmName := 'result';
|
locStrPrmName := 'result';
|
||||||
locSerializer.Get(TypeInfo(TUser), locStrPrmName, Result);
|
locSerializer.Get(TypeInfo(TUser), locStrPrmName, Result);
|
||||||
|
|
||||||
@@ -155,7 +155,7 @@ Begin
|
|||||||
End;
|
End;
|
||||||
|
|
||||||
function TUserService_Proxy.Delete(
|
function TUserService_Proxy.Delete(
|
||||||
const AName : string
|
const AName : UnicodeString
|
||||||
):boolean;
|
):boolean;
|
||||||
Var
|
Var
|
||||||
locSerializer : IFormatterClient;
|
locSerializer : IFormatterClient;
|
||||||
@@ -166,7 +166,7 @@ Begin
|
|||||||
locSerializer := GetSerializer();
|
locSerializer := GetSerializer();
|
||||||
Try
|
Try
|
||||||
locSerializer.BeginCall('Delete', GetTarget(),locCallContext);
|
locSerializer.BeginCall('Delete', GetTarget(),locCallContext);
|
||||||
locSerializer.Put('AName', TypeInfo(string), AName);
|
locSerializer.Put('AName', TypeInfo(UnicodeString), AName);
|
||||||
locSerializer.EndCall();
|
locSerializer.EndCall();
|
||||||
|
|
||||||
MakeCall();
|
MakeCall();
|
||||||
|
Reference in New Issue
Block a user