Einzelnen Beitrag anzeigen

Blackpit

Registriert seit: 27. Feb 2019
77 Beiträge
 
#1

Problem beim SOAP Abruf

  Alt 15. Jan 2020, 14:03
Hallo,
ich hab hier ein Problem das ich mir nicht erklären kann.
Beim Abruf eines Webservice über das importierte WSDL bekomme ich folgende Meldung:
Zitat:
'Die Anforderung konnte vom Server nicht verarbeitet werden. ---> Der Objektverweis wurde nicht auf eine Objektinstanz festgelegt.'
Interface (Auszug):

Delphi-Quellcode:
// ************************************************************************ //
// Die in dieser Datei deklarierten Typen wurden aus Daten der unten
// beschriebenen WSDL-Datei generiert:

// WSDL : https://...de/services/api/salesservice.asmx?WSDL
// >Import : https://...de/services/api/salesservice.asmx?WSDL>0
// Codierung : utf-8
// Codegen : [wfForceSOAP12+]
// Version: 1.0
// (13.01.2020 15:14:48 - - $Rev: 76228 $)
// ************************************************************************ //

unit salesservice;

interface

uses Soap.InvokeRegistry, Soap.SOAPHTTPClient, System.Types, Soap.XSBuiltIns;

const
  IS_OPTN = $0001;
  IS_UNBD = $0002;
  IS_NLBL = $0004;
  IS_REF = $0080;


type

  // ************************************************************************ //
  // Die folgenden Typen, auf die im WSDL-Dokument Bezug genommen wird, sind in dieser Datei
  // nicht repräsentiert. Sie sind entweder Aliase[@] anderer repräsentierter Typen oder auf sie wurde Bezug genommen,
  // aber sie sind in diesem Dokument nicht[!] deklariert. Die Typen aus letzterer Kategorie
  // sind in der Regel vordefinierten/bekannten XML- oder Embarcadero-Typen zugeordnet; sie könnten aber auf
  // ein inkorrektes WSDL-Dokument hinweisen, das einen Schematyp nicht deklariert oder importiert hat.
  // ************************************************************************ //
  // !:int - "http://www.w3.org/2001/XMLSchema"[Gbl]
  // !:string - "http://www.w3.org/2001/XMLSchema"[Gbl]
  // !:decimal - "http://www.w3.org/2001/XMLSchema"[Gbl]

  DealerInformationModel = class; { "http://www.servadr.de/"[GblCplx] }
  WebLogin2 = class; { "http://www.servadr.de/"[Hdr][GblCplx] }
  WebLogin = class; { "http://www.servadr.de/"[Hdr][GblElm] }
  CompleteVehicleInformationModel = class; { "http://www.servadr.de/"[GblCplx] }
  PaymentConditionModel = class; { "http://www.servadr.de/"[GblCplx] }
  EquipmentModel = class; { "http://www.servadr.de/"[GblCplx] }

...
  // ************************************************************************ //
  // XML : WebLogin, global, <complexType>
  // Namespace : http://www.servadr.de/
  // Info : Header
  // ************************************************************************ //
  WebLogin2 = class(TSOAPHeader)
  private
    FUser: string;
    FUser_Specified: boolean;
    FPassword: string;
    FPassword_Specified: boolean;
    FLanguage: Integer;
    procedure SetUser(Index: Integer; const Astring: string);
    function User_Specified(Index: Integer): boolean;
    procedure SetPassword(Index: Integer; const Astring: string);
    function Password_Specified(Index: Integer): boolean;
  published
    property User: string Index (IS_OPTN) read FUser write SetUser stored User_Specified;
    property Password: string Index (IS_OPTN) read FPassword write SetPassword stored Password_Specified;
    property Language: Integer read FLanguage write FLanguage;
  end;



  // ************************************************************************ //
  // XML : WebLogin, global, <element>
  // Namespace : http://www.web-kat.de/
  // Info : Header
  // ************************************************************************ //
  WebLogin = class(WebLogin2)
  private
  published
  end;

  ArrayOfEquipmentModel = array of EquipmentModel; { "http://www.servadr.de/"[GblCplx] }
...

  // ************************************************************************ //
  // XML : CompleteVehicleInformationModel, global, <complexType>
  // Namespace : http://www.servadr.de/
  // ************************************************************************ //
  CompleteVehicleInformationModel = class(TRemotable)
  private
    FDealerInformation: DealerInformationModel;
    FDealerInformation_Specified: boolean;
    FEquipment: ArrayOfEquipmentModel;
    FEquipment_Specified: boolean;
    FPaymentConditions: ArrayOfPaymentConditionModel;
    FPaymentConditions_Specified: boolean;
    procedure SetDealerInformation(Index: Integer; const ADealerInformationModel: DealerInformationModel);
    function DealerInformation_Specified(Index: Integer): boolean;
    procedure SetEquipment(Index: Integer; const AArrayOfEquipmentModel: ArrayOfEquipmentModel);
    function Equipment_Specified(Index: Integer): boolean;
    procedure SetPaymentConditions(Index: Integer; const AArrayOfPaymentConditionModel: ArrayOfPaymentConditionModel);
    function PaymentConditions_Specified(Index: Integer): boolean;
  public
    destructor Destroy; override;
  published
    property DealerInformation: DealerInformationModel Index (IS_OPTN) read FDealerInformation write SetDealerInformation stored DealerInformation_Specified;
    property Equipment: ArrayOfEquipmentModel Index (IS_OPTN) read FEquipment write SetEquipment stored Equipment_Specified;
    property PaymentConditions: ArrayOfPaymentConditionModel Index (IS_OPTN) read FPaymentConditions write SetPaymentConditions stored PaymentConditions_Specified;
  end;
...
  // ************************************************************************ //
  // XML : EquipmentModel, global, <complexType>
  // Namespace : http://www.servadr.de/
  // ************************************************************************ //
  EquipmentModel = class(TRemotable)
  private
    FOrderPos: string;
    FOrderPos_Specified: boolean;
    FCondition: string;
    FCondition_Specified: boolean;
    FDescription: string;
    FDescription_Specified: boolean;
    FVarcond: string;
    FVarcond_Specified: boolean;
    FAmount: string;
    FAmount_Specified: boolean;
    FQuantity: TXSDecimal;
    FUnit_: string;
    FUnit__Specified: boolean;
    FTotalAmount: string;
    FTotalAmount_Specified: boolean;
    FCurrency: string;
    FCurrency_Specified: boolean;
    FListPrice: TXSDecimal;
    procedure SetOrderPos(Index: Integer; const Astring: string);
    function OrderPos_Specified(Index: Integer): boolean;
    procedure SetCondition(Index: Integer; const Astring: string);
    function Condition_Specified(Index: Integer): boolean;
    procedure SetDescription(Index: Integer; const Astring: string);
    function Description_Specified(Index: Integer): boolean;
    procedure SetVarcond(Index: Integer; const Astring: string);
    function Varcond_Specified(Index: Integer): boolean;
    procedure SetAmount(Index: Integer; const Astring: string);
    function Amount_Specified(Index: Integer): boolean;
    procedure SetUnit_(Index: Integer; const Astring: string);
    function Unit__Specified(Index: Integer): boolean;
    procedure SetTotalAmount(Index: Integer; const Astring: string);
    function TotalAmount_Specified(Index: Integer): boolean;
    procedure SetCurrency(Index: Integer; const Astring: string);
    function Currency_Specified(Index: Integer): boolean;
  public
    destructor Destroy; override;
  published
    property OrderPos: string Index (IS_OPTN) read FOrderPos write SetOrderPos stored OrderPos_Specified;
    property Condition: string Index (IS_OPTN) read FCondition write SetCondition stored Condition_Specified;
    property Description: string Index (IS_OPTN) read FDescription write SetDescription stored Description_Specified;
    property Varcond: string Index (IS_OPTN) read FVarcond write SetVarcond stored Varcond_Specified;
    property Amount: string Index (IS_OPTN) read FAmount write SetAmount stored Amount_Specified;
    property Quantity: TXSDecimal read FQuantity write FQuantity;
    property Unit_: string Index (IS_OPTN) read FUnit_ write SetUnit_ stored Unit__Specified;
    property TotalAmount: string Index (IS_OPTN) read FTotalAmount write SetTotalAmount stored TotalAmount_Specified;
    property Currency: string Index (IS_OPTN) read FCurrency write SetCurrency stored Currency_Specified;
    property ListPrice: TXSDecimal Index (IS_NLBL) read FListPrice write FListPrice;
  end;


  // ************************************************************************ //
  // Namespace : http://www.servadr.de/
  // soapAction: http://www.servadr.de/%operationName%
  // Transport : http://schemas.xmlsoap.org/soap/http
  // Stil : document
  // Verwenden von : literal
  // Bindung : SalesServiceSoap12
  // Service : SalesService
  // Port : SalesServiceSoap12
  // URL : https://***.servadr.de/services/api/salesservice.asmx
  // ************************************************************************ //
  SalesServiceSoap = interface(IInvokable)
  ['{396126E1-AD85-AECB-491F-8E2880413151}']

    // Header: WebLogin:pIn
    function DealerInformationPerVehicle(const vehicleNumber: string): DealerInformationModel; stdcall;

    // Header: WebLogin:pIn
    function EquipmentPerVehicle(const vehicleNumber: string): ArrayOfEquipmentModel; stdcall;

    // Header: WebLogin:pIn
    function PaymentConditions(const vehicleNumber: string): ArrayOfPaymentConditionModel; stdcall;

    // Header: WebLogin:pIn
    function CompleteVehicleInformation(const vehicleNumber: string): CompleteVehicleInformationModel; stdcall;
  end;

function GetSalesServiceSoap(UseWSDL: Boolean=System.False; Addr: string=''; HTTPRIO: THTTPRIO = nil): SalesServiceSoap;
Aufruf im Program
Delphi-Quellcode:
var
myService : SalesServiceSoap;
myLogin : WebLogin;
myInfo : CompleteVehicleInformationModel;
myEquipment : ArrayOfEquipmentModel;

begin
 myService := GetSalesServiceSoap();
 myLogin := WebLogin.Create;
 myLogin.User := edt1.Text;
 myLogin.Password := edt2.Text;
 myLogin.Language := 1;
 myInfo := myService.CompleteVehicleInformation(edt3.text); // <= hier kommt der Fehler!
...
Was mach ich falsch?

Geändert von Blackpit (15. Jan 2020 um 15:32 Uhr)
  Mit Zitat antworten Zitat