2012-05-29 96 views
0

我生成使用XE2的WSDL向导界面文件(接口文件出现在该列表的底部)访问冲突分配时SOAP物业 - 德尔福XE2

当我尝试myPaxActivity的“begin_”属性在运行时我给你得到一个A/V,不明白为什么。

在我看来,我已经实例化了myPaxActivity对象,我想我应该能够为.begin_属性赋值。

赞赏任何帮助,TIA

我跑德尔福XE2,更新3,WINXP(SP3)。

这里是我的代码(见〜LN 60):

unit Unit1; 

interface 

uses 
    Winapi.Windows, Winapi.Messages, System.SysUtils, System.Variants, System.Classes, Vcl.Graphics, 
    Vcl.Controls, Vcl.Forms, Vcl.Dialogs, Vcl.StdCtrls, 
    ScheduleUploadV2, Soap.InvokeRegistry, Soap.Rio, Soap.SOAPHTTPClient; 

type 
    TForm1 = class(TForm) 
    btnTest: TButton; 
    HTTPRIO1: THTTPRIO; 
    procedure btnTestClick(Sender: TObject); 
    private 
    procedure SendToAvinode(); 

    public 
    { Public declarations } 
    end; 

var 
    Form1: TForm1; 

implementation 

{$R *.dfm} 

procedure TForm1.btnTestClick(Sender: TObject); 
begin 
    SendToAvinode; 
end; 


procedure TForm1.SendToAvinode; 
var 
    myAviSchedContainer : ScheduleContainerType; 
    Uploader   : ScheduleUploadV2WS; 
    WSResponse  : StatusType; 

    myPlane   : AircraftType; 
    mySched   : ScheduleType; 
    myPaxActivity  : PAXActivityType; 
    arrSched   : Array_Of_ScheduleType; //array[0..1] of ScheduleType; 

    ErrorCount, i : Integer; 
    ThisError : ErrorType; 
    ErrAccum: string; 

begin 
    myAviSchedContainer := ScheduleContainerType.Create; 
    mySched    := ScheduleType.Create; 
    myPlane    := AircraftType.Create; 
    myPaxActivity  := PAXActivityType.Create; 

    // Aircraft 
    myPlane.tail := 'CL-001'; 
    mySched.aircraft := myPlane; 

    // Passenger Activity 
    myPaxActivity.vendorCode := 'TestVCode'; 

     // ***** Next line causes A/V ??? ******* 
    myPaxActivity.begin_.AsDateTime := StrToDateTime('05/21/2012 09:00') ; // <-- 

    myPaxActivity.startAirport.icaoCode := 'KLAX'; 
    myPaxActivity.endAirport.icaoCode := 'KTEB'; 
    myPaxActivity.pax := 2; 
    mySched.paxActivity[0] := myPaxActivity; 

    myAviSchedContainer.schedule[0] := mySched; 

    // issue request w/ user authentication 
    HTTPRIO1.HTTPWebNode.UserName := 'integrationcl'; 
    HTTPRIO1.HTTPWebNode.Password := 'devpass2'; 
    Uploader := GetScheduleUploadV2WS(False, '', HTTPRIO1); 
    WSResponse := Uploader.request(myAviSchedContainer); 

    ErrorCount := SizeOf(WSResponse.errors); 
    for i := 0 to ErrorCount do begin 
    ThisError := WSResponse.errors[i]; 
    ErrAccum := ErrAccum + ThisError.message_ + '||'; 
    end; 

    ShowMessage('Error List ' + ErrAccum); 

    myPaxActivity.Free; 
    myPlane.Free; 
    mySched.Free; 
    myAviSchedContainer.Free; 
end; 

end. 

这里是由WSDL向导生成的接口文件(我截断的getter/setter部分保持30000字符范围内这个帖子) :

unit ScheduleUploadV2; 

interface 

uses InvokeRegistry, SOAPHTTPClient, Types, XSBuiltIns; 

const 
    IS_OPTN = $0001; 
    IS_UNBD = $0002; 
    IS_NLBL = $0004; 
    IS_ATTR = $0010; 
    IS_TEXT = $0020; 


type 

    // ************************************************************************ // 
    // The following types, referred to in the WSDL document are not being represented 
    // in this file. They are either aliases[@] of other types represented or were referred 
    // to but never[!] declared in the document. The types from the latter category 
    // typically map to predefined/known XML or Embarcadero types; however, they could also 
    // indicate incorrect WSDL documents that failed to declare or import a schema type. 
    // ************************************************************************ // 
    // !:boolean   - "http://www.w3.org/2001/XMLSchema"[Gbl] 
    // !:duration  - "http://www.w3.org/2001/XMLSchema"[Gbl] 
    // !:string   - "http://www.w3.org/2001/XMLSchema"[Gbl] 
    // !:date   - "http://www.w3.org/2001/XMLSchema"[Gbl] 
    // !:int    - "http://www.w3.org/2001/XMLSchema"[Gbl] 
    // !:decimal   - "http://www.w3.org/2001/XMLSchema"[Gbl] 
    // !:long   - "http://www.w3.org/2001/XMLSchema"[Gbl] 
    // !:dateTime  - "http://www.w3.org/2001/XMLSchema"[Gbl] 

    ContactInfoType  = class;     { "http://www.fubar.com/core/CommonTypes"[GblCplx] } 
    ActivityFBOType  = class;     { "http://www.fubar.com/integration/ScheduleUpload"[GblCplx] } 
    ActivityRegulationType = class;    { "http://www.fubar.com/integration/ScheduleUpload"[GblCplx] } 
    ActivityState  = class;     { "http://www.fubar.com/integration/ScheduleUpload"[GblCplx] } 
    ScheduleContainerType = class;    { "http://www.fubar.com/integration/ScheduleUpload"[GblCplx] } 
    CompanyType   = class;     { "http://www.fubar.com/core/CommonTypes"[GblCplx] } 
    AircraftType   = class;     { "http://www.fubar.com/core/CommonTypes"[GblCplx] } 
    ErrorType   = class;     { "http://www.fubar.com/core/CommonTypes"[GblCplx] } 
    StatusType   = class;     { "http://www.fubar.com/core/CommonTypes"[GblCplx] } 
    AirportType   = class;     { "http://www.fubar.com/core/CommonTypes"[GblCplx] } 
    ArgusRatingType  = class;     { "http://www.fubar.com/core/CommonTypes"[GblCplx] } 
    DistanceType   = class;     { "http://www.fubar.com/core/CommonTypes"[GblCplx] } 
    InsuranceType  = class;     { "http://www.fubar.com/core/CommonTypes"[GblCplx] } 
    ScheduleType   = class;     { "http://www.fubar.com/integration/ScheduleUpload"[GblCplx] } 
    AbstractActivityType = class;     { "http://www.fubar.com/integration/ScheduleUpload"[GblCplx] } 
    GuaranteeActivityType = class;    { "http://www.fubar.com/integration/ScheduleUpload"[GblCplx] } 
    GenericActivityType = class;     { "http://www.fubar.com/integration/ScheduleUpload"[GblCplx] } 
    PAXActivityType  = class;     { "http://www.fubar.com/integration/ScheduleUpload"[GblCplx] } 
    MonetaryType   = class;     { "http://www.fubar.com/core/CommonTypes"[GblCplx] } 

    {$SCOPEDENUMS ON} 
    { "http://www.fubar.com/integration/ScheduleUpload"[GblSmpl] } 
    FBOSourceType = (UNIVERSAL, ACUKWIK, OWN, OTHER); 

    { "http://www.fubar.com/core/CommonTypes"[GblSmpl] } 
    ErrorCodeType = (
     S0, 
     S1, 
     A0, 
     A1, 
     A2, 
     A3, 
     A4, 
     A5, 
     I0, 
     I1, 
     I2, 
     I3, 
     B0 
); 

    { "http://www.fubar.com/core/CommonTypes"[GblSmpl] } 
    StatusCodeType = (S, F, PS); 

    { "http://www.fubar.com/core/CommonTypes"[GblSmpl] } 
    DistanceUnitType = (NM, MI, KM); 

    {$SCOPEDENUMS OFF} 

    Array_Of_GuaranteeActivityType = array of GuaranteeActivityType; { "http://www.fubar.com/integration/ScheduleUpload"[GblUbnd] } 
    Array_Of_ScheduleType = array of ScheduleType; { "http://www.fubar.com/integration/ScheduleUpload"[GblUbnd] } 
    Array_Of_PAXActivityType = array of PAXActivityType; { "http://www.fubar.com/integration/ScheduleUpload"[GblUbnd] } 
    Array_Of_GenericActivityType = array of GenericActivityType; { "http://www.fubar.com/integration/ScheduleUpload"[GblUbnd] } 



    // ************************************************************************ // 
    // XML  : ActivityFBOType, global, <complexType> 
    // Namespace : http://www.fubar.com/integration/ScheduleUpload 
    // ************************************************************************ // 
    ActivityFBOType = class(TRemotable) 
    private 
    FfboSource: FBOSourceType; 
    FfboId: string; 
    FfboId_Specified: boolean; 
    FfboName: string; 
    procedure SetfboId(Index: Integer; const Astring: string); 
    function fboId_Specified(Index: Integer): boolean; 
    published 
    property fboSource: FBOSourceType read FfboSource write FfboSource; 
    property fboId:  string   Index (IS_OPTN) read FfboId write SetfboId stored fboId_Specified; 
    property fboName: string   read FfboName write FfboName; 
    end; 



    // ************************************************************************ // 
    // XML  : ActivityRegulationType, global, <complexType> 
    // Namespace : http://www.fubar.com/integration/ScheduleUpload 
    // ************************************************************************ // 
    ActivityRegulationType = class(TRemotable) 
    private 
    Fcode: string; 
    Fdescription: string; 
    published 
    property code:  string read Fcode write Fcode; 
    property description: string read Fdescription write Fdescription; 
    end; 



    // ************************************************************************ // 
    // XML  : ActivityState, global, <complexType> 
    // Namespace : http://www.fubar.com/integration/ScheduleUpload 
    // ************************************************************************ // 
    ActivityState = class(TRemotable) 
    private 
    FvendorId: string; 
    Fclear: Boolean; 
    published 
    property vendorId: string read FvendorId write FvendorId; 
    property clear: Boolean read Fclear write Fclear; 
    end; 



    // ************************************************************************ // 
    // XML  : ScheduleContainerType, global, <complexType> 
    // Namespace : http://www.fubar.com/integration/ScheduleUpload 
    // ************************************************************************ // 
    ScheduleContainerType = class(TRemotable) 
    private 
    Fproduct: string; 
    Fschedule: Array_Of_ScheduleType; 
    Fschedule_Specified: boolean; 
    procedure Setschedule(Index: Integer; const AArray_Of_ScheduleType: Array_Of_ScheduleType); 
    function schedule_Specified(Index: Integer): boolean; 
    public 
    destructor Destroy; override; 
    published 
    property product: string     read Fproduct write Fproduct; 
    property schedule: Array_Of_ScheduleType Index (IS_OPTN or IS_UNBD or IS_NLBL) read Fschedule write Setschedule stored schedule_Specified; 
    end; 



    // ************************************************************************ // 
    // XML  : CompanyType, global, <complexType> 
    // Namespace : http://www.fubar.com/core/CommonTypes 
    // ************************************************************************ // 
    CompanyType = class(TRemotable) 
    private 
    Fname_: string; 
    FcertificateNumber: string; 
    FcertificateNumber_Specified: boolean; 
    Fcode: string; 
    Fcode_Specified: boolean; 
    FcontactInfo: ContactInfoType; 
    FcontactInfo_Specified: boolean; 
    FargusRating: ArgusRatingType; 
    FargusRating_Specified: boolean; 
    procedure SetcertificateNumber(Index: Integer; const Astring: string); 
    function certificateNumber_Specified(Index: Integer): boolean; 
    procedure Setcode(Index: Integer; const Astring: string); 
    function code_Specified(Index: Integer): boolean; 
    procedure SetcontactInfo(Index: Integer; const AContactInfoType: ContactInfoType); 
    function contactInfo_Specified(Index: Integer): boolean; 
    procedure SetargusRating(Index: Integer; const AArgusRatingType: ArgusRatingType); 
    function argusRating_Specified(Index: Integer): boolean; 
    public 
    destructor Destroy; override; 
    published 
    property name_:    string   read Fname_ write Fname_; 
    property certificateNumber: string   Index (IS_OPTN) read FcertificateNumber write SetcertificateNumber stored certificateNumber_Specified; 
    property code:    string   Index (IS_OPTN) read Fcode write Setcode stored code_Specified; 
    property contactInfo:  ContactInfoType Index (IS_OPTN) read FcontactInfo write SetcontactInfo stored contactInfo_Specified; 
    property argusRating:  ArgusRatingType Index (IS_OPTN) read FargusRating write SetargusRating stored argusRating_Specified; 
    end; 



    // ************************************************************************ // 
    // XML  : AircraftType, global, <complexType> 
    // Namespace : http://www.fubar.com/core/CommonTypes 
    // ************************************************************************ // 
    AircraftType = class(TRemotable) 
    private 
    Ftail: string; 
    Fmodel: string; 
    Fmodel_Specified: boolean; 
    FyearOfMake: string; 
    FyearOfMake_Specified: boolean; 
    FinteriorRefurbished: TXSDate; 
    FinteriorRefurbished_Specified: boolean; 
    FexteriorRefurbished: TXSDate; 
    FexteriorRefurbished_Specified: boolean; 
    FmaxPAX: Integer; 
    FmaxPAX_Specified: boolean; 
    Foperator: CompanyType; 
    Foperator_Specified: boolean; 
    FhomeBase: AirportType; 
    FhomeBase_Specified: boolean; 
    FminimumDayUsage: TXSDuration; 
    FminimumDayUsage_Specified: boolean; 
    FminimumLegUsage: TXSDuration; 
    FminimumLegUsage_Specified: boolean; 
    Fequipment: Array_Of_string; 
    Fequipment_Specified: boolean; 
    Frange: DistanceType; 
    Frange_Specified: boolean; 
    Finsurance: InsuranceType; 
    Finsurance_Specified: boolean; 
    FtotalTimeAirframe: Integer; 
    FtotalTimeAirframe_Specified: boolean; 
    procedure Setmodel(Index: Integer; const Astring: string); 
    function model_Specified(Index: Integer): boolean; 
    procedure SetyearOfMake(Index: Integer; const Astring: string); 
    function yearOfMake_Specified(Index: Integer): boolean; 
    procedure SetinteriorRefurbished(Index: Integer; const ATXSDate: TXSDate); 
    function interiorRefurbished_Specified(Index: Integer): boolean; 
    procedure SetexteriorRefurbished(Index: Integer; const ATXSDate: TXSDate); 
    function exteriorRefurbished_Specified(Index: Integer): boolean; 
    procedure SetmaxPAX(Index: Integer; const AInteger: Integer); 
    function maxPAX_Specified(Index: Integer): boolean; 
    procedure Setoperator(Index: Integer; const ACompanyType: CompanyType); 
    function operator_Specified(Index: Integer): boolean; 
    procedure SethomeBase(Index: Integer; const AAirportType: AirportType); 
    function homeBase_Specified(Index: Integer): boolean; 
    procedure SetminimumDayUsage(Index: Integer; const ATXSDuration: TXSDuration); 
    function minimumDayUsage_Specified(Index: Integer): boolean; 
    procedure SetminimumLegUsage(Index: Integer; const ATXSDuration: TXSDuration); 
    function minimumLegUsage_Specified(Index: Integer): boolean; 
    procedure Setequipment(Index: Integer; const AArray_Of_string: Array_Of_string); 
    function equipment_Specified(Index: Integer): boolean; 
    procedure Setrange(Index: Integer; const ADistanceType: DistanceType); 
    function range_Specified(Index: Integer): boolean; 
    procedure Setinsurance(Index: Integer; const AInsuranceType: InsuranceType); 
    function insurance_Specified(Index: Integer): boolean; 
    procedure SettotalTimeAirframe(Index: Integer; const AInteger: Integer); 
    function totalTimeAirframe_Specified(Index: Integer): boolean; 
    public 
    destructor Destroy; override; 
    published 
    property tail:    string   read Ftail write Ftail; 
    property model:    string   Index (IS_OPTN) read Fmodel write Setmodel stored model_Specified; 
    property yearOfMake:   string   Index (IS_OPTN) read FyearOfMake write SetyearOfMake stored yearOfMake_Specified; 
    property interiorRefurbished: TXSDate   Index (IS_OPTN) read FinteriorRefurbished write SetinteriorRefurbished stored interiorRefurbished_Specified; 
    property exteriorRefurbished: TXSDate   Index (IS_OPTN) read FexteriorRefurbished write SetexteriorRefurbished stored exteriorRefurbished_Specified; 
    property maxPAX:    Integer   Index (IS_OPTN) read FmaxPAX write SetmaxPAX stored maxPAX_Specified; 
    property operator:   CompanyType  Index (IS_OPTN) read Foperator write Setoperator stored operator_Specified; 
    property homeBase:   AirportType  Index (IS_OPTN) read FhomeBase write SethomeBase stored homeBase_Specified; 
    property minimumDayUsage:  TXSDuration  Index (IS_OPTN) read FminimumDayUsage write SetminimumDayUsage stored minimumDayUsage_Specified; 
    property minimumLegUsage:  TXSDuration  Index (IS_OPTN) read FminimumLegUsage write SetminimumLegUsage stored minimumLegUsage_Specified; 
    property equipment:   Array_Of_string Index (IS_OPTN or IS_UNBD or IS_NLBL) read Fequipment write Setequipment stored equipment_Specified; 
    property range:    DistanceType  Index (IS_OPTN) read Frange write Setrange stored range_Specified; 
    property insurance:   InsuranceType Index (IS_OPTN) read Finsurance write Setinsurance stored insurance_Specified; 
    property totalTimeAirframe: Integer   Index (IS_OPTN) read FtotalTimeAirframe write SettotalTimeAirframe stored totalTimeAirframe_Specified; 
    end; 

    // ************************************************************************ // 
    // XML  : StatusType, global, <complexType> 
    // Namespace : http://www.fubar.com/core/CommonTypes 
    // ************************************************************************ // 
    StatusType = class(TRemotable) 
    private 
    Fcode: StatusCodeType; 
    Ferrors: ErrorContainerType; 
    Ferrors_Specified: boolean; 
    procedure Seterrors(Index: Integer; const AErrorContainerType: ErrorContainerType); 
    function errors_Specified(Index: Integer): boolean; 
    public 
    destructor Destroy; override; 
    published 
    property code: StatusCodeType  read Fcode write Fcode; 
    property errors: ErrorContainerType Index (IS_OPTN) read Ferrors write Seterrors stored errors_Specified; 
    end; 



    // ************************************************************************ // 
    // XML  : AirportType, global, <complexType> 
    // Namespace : http://www.fubar.com/core/CommonTypes 
    // ************************************************************************ // 
    AirportType = class(TRemotable) 
    private 
    FfubarId: Int64; 
    FfubarId_Specified: boolean; 
    FicaoCode: string; 
    FicaoCode_Specified: boolean; 
    FiataCode: string; 
    FiataCode_Specified: boolean; 
    FfaaCode: string; 
    FfaaCode_Specified: boolean; 
    Fname_: string; 
    Fname__Specified: boolean; 
    Fcity: string; 
    Fcity_Specified: boolean; 
    Fcountry: string; 
    Fcountry_Specified: boolean; 
    procedure SetfubarId(Index: Integer; const AInt64: Int64); 
    function fubarId_Specified(Index: Integer): boolean; 
    procedure SeticaoCode(Index: Integer; const Astring: string); 
    function icaoCode_Specified(Index: Integer): boolean; 
    procedure SetiataCode(Index: Integer; const Astring: string); 
    function iataCode_Specified(Index: Integer): boolean; 
    procedure SetfaaCode(Index: Integer; const Astring: string); 
    function faaCode_Specified(Index: Integer): boolean; 
    procedure Setname_(Index: Integer; const Astring: string); 
    function name__Specified(Index: Integer): boolean; 
    procedure Setcity(Index: Integer; const Astring: string); 
    function city_Specified(Index: Integer): boolean; 
    procedure Setcountry(Index: Integer; const Astring: string); 
    function country_Specified(Index: Integer): boolean; 
    published 
    property fubarId: Int64 Index (IS_ATTR or IS_OPTN) read FfubarId write SetfubarId stored fubarId_Specified; 
    property icaoCode: string Index (IS_OPTN) read FicaoCode write SeticaoCode stored icaoCode_Specified; 
    property iataCode: string Index (IS_OPTN) read FiataCode write SetiataCode stored iataCode_Specified; 
    property faaCode: string Index (IS_OPTN) read FfaaCode write SetfaaCode stored faaCode_Specified; 
    property name_:  string Index (IS_OPTN) read Fname_ write Setname_ stored name__Specified; 
    property city:  string Index (IS_OPTN) read Fcity write Setcity stored city_Specified; 
    property country: string Index (IS_OPTN) read Fcountry write Setcountry stored country_Specified; 
    end; 


    // ************************************************************************ // 
    // XML  : ScheduleType, global, <complexType> 
    // Namespace : http://www.fubar.com/integration/ScheduleUpload 
    // ************************************************************************ // 
    ScheduleType = class(TRemotable) 
    private 
    Fclear: Boolean; 
    Faircraft: AircraftType; 
    Fbegin_: TXSDateTime; 
    Fbegin__Specified: boolean; 
    Fend_: TXSDateTime; 
    Fend__Specified: boolean; 
    Fguarantee: Array_Of_GuaranteeActivityType; 
    Fguarantee_Specified: boolean; 
    Factivity: Array_Of_GenericActivityType; 
    Factivity_Specified: boolean; 
    FpaxActivity: Array_Of_PAXActivityType; 
    FpaxActivity_Specified: boolean; 
    procedure Setbegin_(Index: Integer; const ATXSDateTime: TXSDateTime); 
    function begin__Specified(Index: Integer): boolean; 
    procedure Setend_(Index: Integer; const ATXSDateTime: TXSDateTime); 
    function end__Specified(Index: Integer): boolean; 
    procedure Setguarantee(Index: Integer; const AArray_Of_GuaranteeActivityType: Array_Of_GuaranteeActivityType); 
    function guarantee_Specified(Index: Integer): boolean; 
    procedure Setactivity(Index: Integer; const AArray_Of_GenericActivityType: Array_Of_GenericActivityType); 
    function activity_Specified(Index: Integer): boolean; 
    procedure SetpaxActivity(Index: Integer; const AArray_Of_PAXActivityType: Array_Of_PAXActivityType); 
    function paxActivity_Specified(Index: Integer): boolean; 
    public 
    destructor Destroy; override; 
    published 
    property clear:  Boolean       read Fclear write Fclear; 
    property aircraft: AircraftType     read Faircraft write Faircraft; 
    property begin_:  TXSDateTime      Index (IS_OPTN) read Fbegin_ write Setbegin_ stored begin__Specified; 
    property end_:  TXSDateTime      Index (IS_OPTN) read Fend_ write Setend_ stored end__Specified; 
    property guarantee: Array_Of_GuaranteeActivityType Index (IS_OPTN or IS_UNBD or IS_NLBL) read Fguarantee write Setguarantee stored guarantee_Specified; 
    property activity: Array_Of_GenericActivityType Index (IS_OPTN or IS_UNBD or IS_NLBL) read Factivity write Setactivity stored activity_Specified; 
    property paxActivity: Array_Of_PAXActivityType  Index (IS_OPTN or IS_UNBD or IS_NLBL) read FpaxActivity write SetpaxActivity stored paxActivity_Specified; 
    end; 



    // ************************************************************************ // 
    // XML  : AbstractActivityType, global, <complexType> 
    // Namespace : http://www.fubar.com/integration/ScheduleUpload 
    // ************************************************************************ // 
    AbstractActivityType = class(TRemotable) 
    private 
    FfubarRequestId: Int64; 
    FfubarRequestId_Specified: boolean; 
    Fstate: ActivityState; 
    Fstate_Specified: boolean; 
    Fbegin_: TXSDateTime; 
    Fend_: TXSDateTime; 
    FvendorCode: string; 
    Fnote: string; 
    Fnote_Specified: boolean; 
    FtripIdentifier: string; 
    FtripIdentifier_Specified: boolean; 
    Ffbo: ActivityFBOType; 
    Ffbo_Specified: boolean; 
    Fregulation: ActivityRegulationType; 
    Fregulation_Specified: boolean; 
    procedure SetfubarRequestId(Index: Integer; const AInt64: Int64); 
    function fubarRequestId_Specified(Index: Integer): boolean; 
    procedure Setstate(Index: Integer; const AActivityState: ActivityState); 
    function state_Specified(Index: Integer): boolean; 
    procedure Setnote(Index: Integer; const Astring: string); 
    function note_Specified(Index: Integer): boolean; 
    procedure SettripIdentifier(Index: Integer; const Astring: string); 
    function tripIdentifier_Specified(Index: Integer): boolean; 
    procedure Setfbo(Index: Integer; const AActivityFBOType: ActivityFBOType); 
    function fbo_Specified(Index: Integer): boolean; 
    procedure Setregulation(Index: Integer; const AActivityRegulationType: ActivityRegulationType); 
    function regulation_Specified(Index: Integer): boolean; 
    public 
    destructor Destroy; override; 
    published 
    property fubarRequestId: Int64     Index (IS_ATTR or IS_OPTN) read FfubarRequestId write SetfubarRequestId stored fubarRequestId_Specified; 
    property state:   ActivityState   Index (IS_OPTN) read Fstate write Setstate stored state_Specified; 
    property begin_:   TXSDateTime    read Fbegin_ write Fbegin_; 
    property end_:    TXSDateTime    read Fend_ write Fend_; 
    property vendorCode:  string     read FvendorCode write FvendorCode; 
    property note:    string     Index (IS_OPTN) read Fnote write Setnote stored note_Specified; 
    property tripIdentifier: string     Index (IS_OPTN) read FtripIdentifier write SettripIdentifier stored tripIdentifier_Specified; 
    property fbo:    ActivityFBOType   Index (IS_OPTN) read Ffbo write Setfbo stored fbo_Specified; 
    property regulation:  ActivityRegulationType Index (IS_OPTN) read Fregulation write Setregulation stored regulation_Specified; 
    end; 



    // ************************************************************************ // 
    // XML  : GuaranteeActivityType, global, <complexType> 
    // Namespace : http://www.fubar.com/integration/ScheduleUpload 
    // ************************************************************************ // 
    GuaranteeActivityType = class(AbstractActivityType) 
    private 
    Fduration: TXSDuration; 
    Fairport: AirportType; 
    public 
    destructor Destroy; override; 
    published 
    property duration: TXSDuration read Fduration write Fduration; 
    property airport: AirportType read Fairport write Fairport; 
    end; 



    // ************************************************************************ // 
    // XML  : GenericActivityType, global, <complexType> 
    // Namespace : http://www.fubar.com/integration/ScheduleUpload 
    // ************************************************************************ // 
    GenericActivityType = class(AbstractActivityType) 
    private 
    FstartAirport: AirportType; 
    FendAirport: AirportType; 
    public 
    destructor Destroy; override; 
    published 
    property startAirport: AirportType read FstartAirport write FstartAirport; 
    property endAirport: AirportType read FendAirport write FendAirport; 
    end; 



    // ************************************************************************ // 
    // XML  : PAXActivityType, global, <complexType> 
    // Namespace : http://www.fubar.com/integration/ScheduleUpload 
    // ************************************************************************ // 
    PAXActivityType = class(GenericActivityType) 
    private 
    Fpax: Integer; 
    published 
    property pax: Integer read Fpax write Fpax; 
    end; 

    // ************************************************************************ // 
    // Namespace : http://www.fubar.com/integration/ScheduleUpload 
    // soapAction: http://www.fubar.com/integration/ScheduleUpload#request 
    // transport : http://schemas.xmlsoap.org/soap/http 
    // style  : document 
    // use  : literal 
    // binding : ScheduleUploadWebServiceV2ImplPortBinding 
    // service : ScheduleUploadV2WS 
    // port  : ScheduleUploadWebServiceV2ImplPort 
    // URL  : https://development.fubar.com:443/fubar/fubarIntegrationWeb/ws/ScheduleUploadV2.ws 
    // ************************************************************************ // 
    ScheduleUploadV2WS = interface(IInvokable) 
    ['{85B5395B-1FC2-0EB1-EDB6-1BDB3D2FFE23}'] 
    function request(const schedules: ScheduleContainerType): StatusType; stdcall; 
    end; 

function GetScheduleUploadV2WS(UseWSDL: Boolean=System.False; Addr: string=''; HTTPRIO: THTTPRIO = nil): ScheduleUploadV2WS; 


implementation 
    uses SysUtils; 

function GetScheduleUploadV2WS(UseWSDL: Boolean; Addr: string; HTTPRIO: THTTPRIO): ScheduleUploadV2WS; 
const 
    defWSDL = 'https://development.fubar.com/fubar/fubarIntegrationWeb/ws/ScheduleUploadV2.ws?wsdl'; 
    defURL = 'https://development.fubar.com:443/fubar/fubarIntegrationWeb/ws/ScheduleUploadV2.ws'; 
    defSvc = 'ScheduleUploadV2WS'; 
    defPrt = 'ScheduleUploadWebServiceV2ImplPort'; 
var 
    RIO: THTTPRIO; 
begin 
    Result := nil; 
    if (Addr = '') then 
    begin 
    if UseWSDL then 
     Addr := defWSDL 
    else 
     Addr := defURL; 
    end; 
    if HTTPRIO = nil then 
    RIO := THTTPRIO.Create(nil) 
    else 
    RIO := HTTPRIO; 
    try 
    Result := (RIO as ScheduleUploadV2WS); 
    if UseWSDL then begin 
     RIO.WSDLLocation := Addr; 
     RIO.Service := defSvc; 
     RIO.Port := defPrt; 
    end else 
     RIO.URL := Addr; 
    finally 
    if (Result = nil) and (HTTPRIO = nil) then 
     RIO.Free; 
    end; 
end; 


destructor ScheduleType.Destroy; 
var 
    I: Integ 
+0

.begin_属性的全部内容是什么?我看到一个暴露的属性“pax”,这是一个整数... –

+0

@John - pax事物是'AbstractActivityType'的后裔。用户 - 您不是分配给'begin_'属性,而是分配给'begin_.AsDateTime'。在这个时候检查'begin_'是否被'分配'很容易。 –

+1

Sertac - .begin_属性为nil(因为在不是Assigned()中) - 这是导致访问冲突的原因,因此也是我的问题。我创建了myPaxActivity对象,那么为什么.begin_属性是零? – user1424415

回答

2

实例化(对于这个问题或任何其属性的)一个PAXActivityType对象不会自动实例化begin_ TXSDateTime对象。在实例化PAXActivityType或将一些构造代码写入PAXActivityType之后,您必须实例化begin_,这会在构造函数中为您执行。

+0

Sam - 我如何实例化begin_? – user1424415

+1

myPaxActivity.begin_:= TXSDateTime.Create; –