客户端Web服务

时间:2010-08-16 04:03:14

标签: web-services delphi client

我是一名delphi新手,试图访问网络服务,但无法设置仪器和仪器阵列以添加到请求中。我附上了代码,下面的服务定义,任何帮助都将是一个很大的优势。

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;

当我包含set 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) 私人的   Fid:string;   Fyellowkey:MarketSector;   Fyellowkey_Specified:boolean;   Ftype_:InstrumentType;   Ftype__Specified:boolean;   Foverrides:覆盖;   Foverrides_Specified:boolean;   程序Setyellowkey(索引:整数; const AMarketSector:MarketSector);   function yellowkey_Specified(Index:Integer):boolean;   procedure Settype_(Index:Integer; const AInstrumentType:InstrumentType);   function type__Specified(Index:Integer):boolean;   procedure Setoverrides(Index:Integer; const AOverrides:Overrides);   function overrides_Specified(Index:Integer):boolean; 上市   析构者摧毁;覆盖; 发表   property id:string读取Fid写入Fid;   属性yellowkey:MarketSector
         索引(IS_OPTN)读取Fyellowkey写入Setyellowkey存储yellowkey_Specified;   property type_:InstrumentType
         索引(IS_OPTN)读取Ftype_写入Settype_ stored type__Specified;   财产覆盖:覆盖
         索引(IS_OPTN)读取Foverrides写入Setoverrides存储overrides_Specified; 端;

1 个答案:

答案 0 :(得分:0)

如何定义仪器?