Einzelnen Beitrag anzeigen

Chaosworld

Registriert seit: 26. Nov 2005
6 Beiträge
 
#1

Zugriffsverletzung bei SOAP-Abfrage

  Alt 14. Aug 2008, 19:00
Ich muss Daten über ein SOAP-Portal übertragen. Bei einer einzigen Abfrage erhalte ich leider immer diese Fehlermeldung:
"Zugriffsverletzung bei Adresse 0040435C in Modul 'SDIAPP.exe'. Lesen von Adresse 0000BCED."

Weil ich keine Idee habe, wie ich mich dem Fehler nähern könnte, zuerst die verkürzte Unit die von SOAP-Importer erstellt wurde:

Delphi-Quellcode:
unit TestFacade1;

interface

uses InvokeRegistry, SOAPHTTPClient, Types, XSBuiltIns;
....
  TestFacade = interface(IInvokable)
  ['{27C48D16-7064-823C-0EB4-AA7AD67AD11B}']
...
    function createRIS_QSFindings(const institut: Institut; const findings: AxdRIS_QSFindings): EntityKey; stdcall;
  end;
..
  Institut = class(TRemotable)
  private
    Fname_: WideString;
    Fnumber: WideString;
    Fpassword: WideString;
  published
    property name_: WideString Index (IS_NLBL) read Fname_ write Fname_;
    property number: WideString Index (IS_NLBL) read Fnumber write Fnumber;
    property password: WideString Index (IS_NLBL) read Fpassword write Fpassword;
  end;
...
  AxdRIS_QSFindings = array of finding2;

  finding2 = class(AxdEntity_Finding2)
  private
  published
  end;

  AxdEntity_Finding2 = class(TRemotable)
  private
    FbusRelFinding: Array_Of_AxdEntity_BusRelFinding;
    FRIS_AnalyticalDeficiencyNotCor2Spec: WideString;
    FRIS_CapacityDeficiencyNotCor2Spec: WideString;
...
  public
    destructor Destroy; override;
  published
    property busRelFinding: Array_Of_AxdEntity_BusRelFinding Index (IS_UNBD or IS_NLBL) read FbusRelFinding write FbusRelFinding;
    property RIS_AnalyticalDeficiencyNotCor2Spec: WideString Index (IS_NLBL) read FRIS_AnalyticalDeficiencyNotCor2Spec write FRIS_AnalyticalDeficiencyNotCor2Spec;
    property RIS_CapacityDeficiencyNotCor2Spec: WideString Index (IS_NLBL) read FRIS_CapacityDeficiencyNotCor2Spec write FRIS_CapacityDeficiencyNotCor2Spec;
    property RIS_ContaminationDeficiencyNotCor2Sp: WideString Index
....
  end;

  AxdEntity_BusRelFinding = class(TRemotable)
  private
    FAVA_SAPAccountNum: WideString;
    FbusRelAccount: WideString;
    FbusRelTypeId: WideString;
  published
    property AVA_SAPAccountNum: WideString Index (IS_NLBL) read FAVA_SAPAccountNum write FAVA_SAPAccountNum;
    property busRelAccount: WideString Index (IS_NLBL) read FbusRelAccount write FbusRelAccount;
    property busRelTypeId: WideString Index (IS_NLBL) read FbusRelTypeId write FbusRelTypeId;
  end;
und meine eine Test-Routine:

Delphi-Quellcode:
procedure TSDIAppForm.Button4Click(Sender: TObject);
var firma : Institut;
    Abfrage: TestFacade;
    Antwort: EntityKey;
    findings: finding2;
    Finding: AxdRIS_QSFindings;
    busRelFinding: AxdEntity_BusRelFinding;
    Array_busRelFinding: Array_Of_AxdEntity_BusRelFinding;
Begin
...
  firma:= TestFacade1.Institut.Create;
  firma.name_ :='test';
  firma.number:='123456789';
  firma.password:='test1234';




  findings:=TestFacade1.finding2.Create;
  finding:= AxdRIS_QSFindings.create(findings);


  Array_busRelFinding :=Array_Of_AxdEntity_BusRelFinding.Create(busRelFinding);

  busRelFinding.AVA_SAPAccountNum:='123456789';
  findings.busRelFinding:=Array_busRelFinding;

  findings.RIS_QSExtFindingFlag:='Yes';
  findings.RIS_QSFindingReportStatus:=Closed;
... (hier werden noch einige weitere Parameter gefülllt)
  Abfrage:= HTTPRIO as TestFacade;

  Antwort := TestFacade1.EntityKey.create;
  Antwort:=Abfrage.createRIS_QSFindings(firma,finding); **
genau an der ** Stelle kommt immer der Zugriffsfehler. Wenn ich jedoch die Zeite
  findings.busRelFinding:=Array_busRelFinding; erhalten ich die Exception:
"java.rmi.ServerException accourred in server thread, nested exception is:
java.rmi.RemoteException: ; nested exception is:
java.land.NullPointerException."

Ich geher daher davon aus, dass die Abfrage korrekt rausgesendet wird, und bei der Antwort der Fehler auftritt. Nur weiter komme ich einfach nicht.

Und was dann noch mehr verwirrt, wenn ich busRelFinding komplett fülle, also:
Delphi-Quellcode:
  busRelFinding.AVA_SAPAccountNum:='123456789';
  busRelFinding.busRelAccount:='591892';
  busRelFinding.busRelTypeId:='Institut';
Erhalte ich von Delphi ein
"Invalid Address specified to RtlReAllocateHeap( 00150000, 0013F8BC ) Prozess SDIAPP.exe (8096)"
und Delphi springt ins CPU-Fenster.

Wäre echt super, wenn mir jemand zeigen könnte, wo ich meinen Gedankenfehler mache.
Danke schon mal für jede Antwort

Chaosworld

PS: Benutze Delphi 2007
  Mit Zitat antworten Zitat