Thema: Delphi Webservice

Einzelnen Beitrag anzeigen

TiGü

Registriert seit: 6. Apr 2011
Ort: Berlin
3.060 Beiträge
 
Delphi 10.4 Sydney
 
#26

AW: Webservice

  Alt 26. Apr 2018, 14:43
Das heißt, wir müssen auch noch die Grundlagen der Objekt-orientierten Programmierung mit Delphi durchgehen?
Und der Bedienung von IDE und Debugger?

Delphi-Quellcode:
unit Main;

interface

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

type

  TForm1 = class(TForm)

    Button1: TButton;
    Request: TMemo;
    Response: TMemo;
    Result: TMemo;
    HTTPRIO1: THTTPRIO;
    Label1: TLabel;
    Label2: TLabel;
    Label3: TLabel;
    procedure HTTPRIO1AfterExecute(const MethodName: string;
      SOAPResponse: TStream);
    procedure HTTPRIO1BeforeExecute(const MethodName: string;
      SOAPRequest: TStream);
    procedure Button1Click(Sender: TObject);
  private
    { Private-Deklarationen }
    FLot: ILot;
  public
    { Public-Deklarationen }
  end;

  // GetLotInfoByLotNameRequest2 = class(BaseRequest2);
var
  Form1: TForm1;
  sResult: string;
  CheckSlotPos: boolean;

implementation

{$R *.dfm}


procedure TForm1.Button1Click(Sender: TObject);
var
  URL: string;
  Request: GetLotInfoByLotNameRequest2;
  Response: GetLotInfoByLotNameResponse2; //Oder so ähnlich. Du könntest auch einfach mal alles posten, du Fuchs!
begin
  URL := 'http://tst-rbg14:8019/Lot.svc';
  if not Assigned() then
  begin
    FLot := GetILot(False, URL);
  end;

  Request := GetLotInfoByLotNameRequest2.Create;
  Request.CheckSlotPo := True;
  Request.EquipmentValidation := True;
  Request.LotName := 'BlaBlupp';
  // usw. ich denke das Prinzip ist klar.

  Response := FLot.GetLotInfoByLotName(Request);
  if Assigned(Response) then
  begin
    ShowMessage(Response.IrgendeineTolleEigenschaftDieWirHierJetztNichtKennen);
  end;

end;

//procedure TForm1.HTTPRIO1AfterExecute(const MethodName: string;
// SOAPResponse: TStream);
//begin
//
// SOAPResponse.Position := 0;
// Response.Lines.LoadFromStream(SOAPResponse);
//end;
//
//procedure TForm1.HTTPRIO1BeforeExecute(const MethodName: string;
// SOAPRequest: TStream);
//begin
// SOAPRequest.Position := 0;
// Request.Lines.LoadFromStream(SOAPRequest);
//end;

end.
  Mit Zitat antworten Zitat