客户端Web服务

我是一个德尔福新手,并尝试访问Web服务,并无法设置仪器和仪器阵列添加到请求中。 我附上了代码,下面的服务的定义,任何帮助将是一个很大的优势。

Var 
abc:submitGetDataRequest;
cc:array_of_instrument;
bb:Instrument;

begin
abc:=submitGetDataRequest.Create;
setlength(cc,2);
bb.id:='ABC';
cc[0]:=bb;
bb.id:='DEF';
cc[1]:=bb;

//abc.instruments:=cc;

当我包含设置abc.instruments:= CC它给出了一个编译错误来说不兼容的类型Instruments和array_of_instrument ??? 我以为他们是一样的?

非常感谢

SubmitGetDataRequest = class(TRemotable)
  private
    Fheaders: GetDataHeaders;
    Ffieldsets: BvalFieldSets;
    Ffieldsets_Specified: boolean;
    Ffields: Fields;
    Ffields_Specified: boolean;
    Finstruments: Instruments;
    procedure Setfieldsets(Index: Integer; const ABvalFieldSets: BvalFieldSets);
    function  fieldsets_Specified(Index: Integer): boolean;
    procedure Setfields(Index: Integer; const AFields: Fields);
    function  fields_Specified(Index: Integer): boolean;
  public
    constructor Create; override;
    destructor Destroy; override;
  published
    property headers:     GetDataHeaders  read Fheaders write Fheaders;
    property fieldsets:   BvalFieldSets   Index (IS_OPTN) read Ffieldsets 
                              write Setfieldsets stored fieldsets_Specified;
    property fields:      Fields          Index (IS_OPTN) read Ffields 
                              write Setfields stored fields_Specified;
    property instruments: Instruments     read Finstruments write Finstruments;
  end;

  Array_Of_Instrument = array of Instrument;  
  Array_Of_Macro = array of Macro;            


  Instruments = class(TRemotable)
  private
    Finstrument: Array_Of_Instrument;
    Finstrument_Specified: boolean;
    Fmacro: Array_Of_Macro;
    Fmacro_Specified: boolean;
    procedure Setinstrument(Index: Integer; 
                    const AArray_Of_Instrument: Array_Of_Instrument);
    function  instrument_Specified(Index: Integer): boolean;
    procedure Setmacro(Index: Integer; const AArray_Of_Macro: Array_Of_Macro);
    function  macro_Specified(Index: Integer): boolean;
  public
    destructor Destroy; override;
  published
    property instrument: Array_Of_Instrument  Index (IS_OPTN or IS_UNBD) 
                          read Finstrument write Setinstrument stored instrument_Specified;
    property macro:      Array_Of_Macro       Index (IS_OPTN or IS_UNBD) 
                          read Fmacro write Setmacro stored macro_Specified;
  end;

 Macro = class(TRemotable)
  private
    FprimaryQualifier: PrimaryQualifier;
    FsecondaryQualifier: Array_Of_SecondaryQualifier;
    FsecondaryQualifier_Specified: boolean;
    Foverrides: Overrides;
    Foverrides_Specified: boolean;
    procedure SetsecondaryQualifier(Index: Integer; 
                      const AArray_Of_SecondaryQualifier: Array_Of_SecondaryQualifier);
    function  secondaryQualifier_Specified(Index: Integer): boolean;
    procedure Setoverrides(Index: Integer; const AOverrides: Overrides);
    function  overrides_Specified(Index: Integer): boolean;
  public
    destructor Destroy; override;
  published
    property primaryQualifier:   PrimaryQualifier             
                     read FprimaryQualifier write FprimaryQualifier;
    property secondaryQualifier: Array_Of_SecondaryQualifier  
                     Index (IS_OPTN or IS_UNBD) read FsecondaryQualifier 
                     write SetsecondaryQualifier stored secondaryQualifier_Specified;
    property overrides:          Overrides                    
                     Index (IS_OPTN) read Foverrides 
                     write Setoverrides stored overrides_Specified;
  end;

Instrument = class(TRemotable)private Fid:string; Fkeykey:MarketSector; Fyellowkey_Specified:布尔型; Ftype_:InstrumentType; Ftype__Specified:boolean; 覆盖:覆盖; Foverrides_Specified:boolean; 程序Setyellowkey(Index:Integer; const AMarketSector:MarketSector); 函数yellowkey_Specified(Index:Integer):boolean; 过程Settype_(Index:Integer; const AInstrumentType:InstrumentType); 函数类型___指定(索引:整数):布尔值; 过程Setoverrides(Index:Integer; const AOverrides:Overrides); 函数overrides_Specified(Index:Integer):boolean; 公共析构函数Destroy; 覆盖; 发布属性id:string read Fid write Fid; 财产yellowkey:MarketSector
索引(IS_OPTN)读取键值写入Setyellowkey存储的yellowkey_Specified; 属性type_:InstrumentType
索引(IS_OPTN)读取Ftype_写入Settype_存储类型___指定; 属性覆盖:覆盖
索引(IS_OPTN)读取Foverrides写入Setoverrides存储的覆盖_指定; 结束;


仪器如何定义?

链接地址: http://www.djcxy.com/p/60253.html

上一篇: client side web service

下一篇: Pimpl idiom with inheritance