2010-08-16 222 views
0

我是一个delphi新手,试图访问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它给出了一个编译错误说不兼容的类型仪器和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; 

仪器= A类(TRemotable) 私人 Fid的:字符串; Fellowkey:MarketSector; Fyellowkey_Specified:boolean; Ftype_:InstrumentType; Ftype__Specified:boolean; Foverrides:覆盖; Foverrides_Specified:boolean;程序Setyellowkey(Index:Integer; const AMarketSector:MarketSector); function yellowkey_Specified(Index:Integer):boolean; 程序Settype_(Index:Integer; const AInstrumentType:InstrumentType); 函数类型__指定(索引:整数):布尔型;程序Setoverrides(Index:Integer; const AOverrides:Overrides); 函数overrides_Specified(Index:Integer):boolean; public 析构函数Destroy;覆盖; 已发布 属性ID:字符串读取Fid写入Fid; property yellowkey:MarketSector
Index(IS_OPTN)read Fyellowkey write Setyellowkey stored yellowkey_Specified; 属性type_:InstrumentType
索引(IS_OPTN)读取Ftype_写入Settype_存储类型___指定; 属性覆盖:覆盖
索引(IS_OPTN)读取Foverrides写入Setoverrides存储的覆盖_指定; 结束;

+0

欢迎来到Stack Overflow。它可以帮助你复制和粘贴你的真实代码*。确保你发布的代码没有任何明显的语法错误,例如在变量声明中使用':='。如果人们不能相信你的问题包含了对问题的准确表达,那么他们将不太愿意提供帮助,因为他们担心他们会浪费时间去发现错误,而这些错误实际上只是错误的错误。通过在准备问题时偷工减料,你只会伤害自己。 – 2010-08-16 09:49:24

+0

您是否想要开发使用Web服务发送或接收数据的客户端应用程序?你的代码真的在做什么? – Aqil 2017-11-10 22:46:38

回答

0

仪器是如何定义的?

+0

我想你应该把这个评论,而不是一个答案 – rajeemcariazo 2010-08-16 04:17:05

+0

对不起,但我加了一个答案,而不是评论 – Allan 2010-08-16 04:23:45

+0

他应该有,@Rajeem,但只有29声望点,他不能。艾伦,你应该编辑你的问题。拜伦已经为你解答了你的“答案”,所以你应该尽早在最方便的时候删除你的答案,否则你会冒着人们投票的风险,因为它没有回答这个问题。同样对于这个“答案”。 – 2010-08-16 09:40:36