AGB  ·  Datenschutz  ·  Impressum  







Anmelden
Nützliche Links
Registrieren
Thema durchsuchen
Ansicht
Themen-Optionen

Abgeleitete Klasse korrekt aufrufen

Ein Thema von jsp · begonnen am 24. Okt 2018 · letzter Beitrag vom 24. Okt 2018
 
jsp

Registriert seit: 9. Aug 2003
50 Beiträge
 
#1

Abgeleitete Klasse korrekt aufrufen

  Alt 24. Okt 2018, 08:04
Delphi-Version: 10.2 Tokyo
Hallo zusammen,

ich habe folgende Klassen aus einem wsdl-Import:
Delphi-Quellcode:
  NPKChapter = class(TRemotable)
  private
    Fnumber: string;
    Fnumber_Specified: boolean;
    Ftitle: string;
    Ftitle_Specified: boolean;
    FreleaseYear: Integer;
    Fversion: Integer;
    Flanguage: TLanguage;
    Fstand: Integer;
    FsubNodes: ArrayOfNPKNode;
    FsubNodes_Specified: boolean;
    Fapplication_: ArrayOfNPKApplication;
    Fapplication__Specified: boolean;
    procedure Setnumber(Index: Integer; const Astring: string);
    function number_Specified(Index: Integer): boolean;
    procedure Settitle(Index: Integer; const Astring: string);
    function title_Specified(Index: Integer): boolean;
    procedure SetsubNodes(Index: Integer; const AArrayOfNPKNode: ArrayOfNPKNode);
    function subNodes_Specified(Index: Integer): boolean;
    procedure Setapplication_(Index: Integer; const AArrayOfNPKApplication: ArrayOfNPKApplication);
    function application__Specified(Index: Integer): boolean;
  public
    destructor Destroy; override;
  published
    property number: string Index (IS_OPTN) read Fnumber write Setnumber stored number_Specified;
    property title: string Index (IS_OPTN) read Ftitle write Settitle stored title_Specified;
    property releaseYear: Integer read FreleaseYear write FreleaseYear;
    property version: Integer read Fversion write Fversion;
    property language: TLanguage read Flanguage write Flanguage;
    property stand: Integer read Fstand write Fstand;
    property subNodes: ArrayOfNPKNode Index (IS_OPTN) read FsubNodes write SetsubNodes stored subNodes_Specified;
    property application_: ArrayOfNPKApplication Index (IS_OPTN) read Fapplication_ write Setapplication_ stored application__Specified;
  end;
  
  NPKApplication = class(TRemotable)
  private
    Fnumber: string;
    Fnumber_Specified: boolean;
    Fdescription: string;
    Fdescription_Specified: boolean;
    FcontractRelevant: Boolean;
    procedure Setnumber(Index: Integer; const Astring: string);
    function number_Specified(Index: Integer): boolean;
    procedure Setdescription(Index: Integer; const Astring: string);
    function description_Specified(Index: Integer): boolean;
  published
    property number: string Index (IS_OPTN) read Fnumber write Setnumber stored number_Specified;
    property description: string Index (IS_OPTN) read Fdescription write Setdescription stored description_Specified;
    property contractRelevant: Boolean read FcontractRelevant write FcontractRelevant;
  end;
  
  NPKApplicationTitle = class(NPKApplication)
  private
    FsubNodes: ArrayOfNPKApplication;
    FsubNodes_Specified: boolean;
    procedure SetsubNodes(Index: Integer; const AArrayOfNPKApplication: ArrayOfNPKApplication);
    function subNodes_Specified(Index: Integer): boolean;
  public
    destructor Destroy; override;
  published
    property subNodes: ArrayOfNPKApplication Index (IS_OPTN) read FsubNodes write SetsubNodes stored subNodes_Specified;
  end;
Aufrufen tue ich die abgeleiteten Klassen wie folgt:

Delphi-Quellcode:
  NPK_Chapter := NPKChapter.Create;
  NPK_ApplicationTitle := NPKApplicationTitle.Create;
  NPK_Application := NPKApplication.Create;

  // funktioniert wie erwartet
  NPK_Chapter := soapPartner.downloadNPK(numberStr, dispLanguage, year);
  
  // hier bin ich mir nicht sicher, ob ich die abgeleteten Klassen korrekt aufrufe
  NPK_Application := NPKApplication(NPK_Chapter);
  NPK_ApplicationTitle := NPKApplicationTitle(NPK_Application);
Ist der Aufruf korrekt so?

Gruss, Jörn
  Mit Zitat antworten Zitat
 


Forumregeln

Es ist dir nicht erlaubt, neue Themen zu verfassen.
Es ist dir nicht erlaubt, auf Beiträge zu antworten.
Es ist dir nicht erlaubt, Anhänge hochzuladen.
Es ist dir nicht erlaubt, deine Beiträge zu bearbeiten.

BB-Code ist an.
Smileys sind an.
[IMG] Code ist an.
HTML-Code ist aus.
Trackbacks are an
Pingbacks are an
Refbacks are aus

Gehe zu:

Impressum · AGB · Datenschutz · Nach oben
Alle Zeitangaben in WEZ +1. Es ist jetzt 12:59 Uhr.
Powered by vBulletin® Copyright ©2000 - 2024, Jelsoft Enterprises Ltd.
LinkBacks Enabled by vBSEO © 2011, Crawlability, Inc.
Delphi-PRAXiS (c) 2002 - 2023 by Daniel R. Wolf, 2024 by Thomas Breitkreuz