我觉得yysun这个Web Service做的不好。主要要调用他的方法如listroom后得到的东西
还要自己再去解析,做客户端比较麻烦。要是能返回一个动态数组就好了。这样客户端做
起来就很好做。因为动态数组的结构和表结构一样。我昨天就在做DFW的Web Service,
不过还没有做好,只做了GetRooms这个方法,过两天就可以全部做好。做好后我会放到网
上来和大家一起探讨。
如:
unit RoomsType;
interface
uses InvokeRegistry,Types,XMLSchema;
type
TXSRoom=class;
TXSRoomArray = array of TXSRoom;
TXSRoom = class(TRemotable)
private
FID: LongInt;
FGroup: string;
FMaster: string;
FMaster2: string;
FRoom: string;
published
property ID:LongInt read FID write FID;
property Room : string read FRoom write FRoom;
property Master : string read FMaster write FMaster;
property Master2 : string read FMaster2 write FMaster2;
property Group : string read FGroup write FGroup;
end;
implementation
initialization
RemClassRegistry.RegisterXSClass(TXSRoom, '', 'TXSRoom','');
RemTypeRegistry.RegisterXSInfo(TypeInfo(TXSRoomArray),'','TXSRoomArray');
finalization
RemClassRegistry.UnRegisterXSClass(TXSRoom);
RemTypeRegistry.UnRegisterXSInfo(TypeInfo(TXSRoomArray));
end.
unit DFWIntf;
interface
uses
InvokeRegistry,RoomsType;
type
IDFW = interface(IInvokable)
['{B83DED21-878B-4183-84EF-BF194E2C4FCD}']
function GetRooms : TXSRoomArray ;
stdcall;
end;
implementation
initialization
InvRegistry.RegisterInterface(TypeInfo(IDFW));
end.
unit DFWImpl;
interface
uses
InvokeRegistry,DFWIntf,RoomsType;
type
TDFW = class(TInvokableClass,IDFW)
private
{ Private declarations }
public
function GetRooms : TXSRoomArray ;
stdcall;
end;
implementation
{ TDFW }
function TDFW.GetRooms: TXSRoomArray;
begin
end;
initialization
InvRegistry.RegisterInvokableClass(TDFW);
end.