I am a delphi newbie and trying to access a web service and having trouble setting up the instruments and instrument array to add into a request. I have attached the code, definition of the service below, any help would be a great advantage.
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;
When I include the set the abc.instruments:=CC it gives a compile error to say incompatible types Instruments and array_of_instrument??? I thought they were the same??
Many Thanks
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;
Fyellowkey: MarketSector;
Fyellowkey_Specified: boolean;
Ftype_: InstrumentType;
Ftype__Specified: boolean;
Foverrides: Overrides;
Foverrides_Specified: boolean;
procedure Setyellowkey(Index: Integer; 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;
public
destructor Destroy; override;
published
property id: string read Fid write Fid;
property yellowkey: MarketSector
Index (IS_OPTN) read Fyellowkey write Setyellowkey stored yellowkey_Specified;
property type_: InstrumentType
Index (IS_OPTN) read Ftype_ write Settype_ stored type__Specified;
property overrides: Overrides
Index (IS_OPTN) read Foverrides write Setoverrides stored overrides_Specified;
end;
:=in a variable declaration. If people can't trust that your question contains an accurate representation of the problem, then they will be less willing to help because they will fear that they are wasting their time finding errors that are really just typos in the question. By cutting corners in preparing your question, you're only hurting yourself. - Rob Kennedy