Введите значения в импортированном WSDL Delphi - PullRequest
0 голосов
/ 13 января 2019

Я импортировал файл WSDL с объявленным различным типом. Некоторые из типов объявлены в другом типе. Я хотел бы дать значение для различных элементов типа, но я получил ошибку «нарушение прав доступа». В этом случае эта строка выдает мне ошибку: req.Body.Pack.sn:= '1234'; Пожалуйста, не могли бы вы помочь мне, чего не хватает в моем коде? Как я могу дать значения для различных типов в запросе WSDL?

Импортированный WSDL:

  // ************************************************************************ //
  // XML       : G110Request, global, <element>
  // Namespace : urn:wsdltypes.nmvs.eu:v3.0
  // Serializtn: [xoLiteralParam]
  // Info      : Wrapper
  // ************************************************************************ //
  G110Request = class(I1_SinglePack_Type)
  private
  public
    constructor Create; override;
  published
  end;

  // ************************************************************************ //
  // XML       : I1_SinglePack_Type, global, <complexType>
  // Namespace : urn:types.nmvs.eu:v3.0
  // ************************************************************************ //
  I1_SinglePack_Type = class(Header_Type)
  private
    FBody: RequestData_Type;
  public
    destructor Destroy; override;
  published
    property Body: RequestData_Type  read FBody write FBody;
  end;

  // ************************************************************************ //
  // XML       : RequestData_Type, global, <complexType>
  // Namespace : urn:types.nmvs.eu:v3.0
  // ************************************************************************ //
  RequestData_Type = class(TRemotable)
  private
    FProduct: RequestProduct_Type;
    FPack: RequestPack_Type;
  public
    destructor Destroy; override;
  published
    property Product: RequestProduct_Type  read FProduct write FProduct;
    property Pack:    RequestPack_Type     read FPack write FPack;
  end;

  // ************************************************************************ //
  // XML       : RequestPack_Type, global, <complexType>
  // Namespace : urn:types.nmvs.eu:v3.0
  // ************************************************************************ //
  RequestPack_Type = class(TRemotable)
  private
    Fsn: SN_Type;
  published
    property sn: SN_Type  Index (IS_ATTR or IS_QUAL) read Fsn write Fsn;
  end;

  SN_Type         =  type string;      { "urn:types.nmvs.eu:v3.0"[GblSmpl] }

Мой код:

unit Unit1;

interface

uses
  Winapi.Windows, Winapi.Messages, System.SysUtils, System.Variants, System.Classes, Vcl.Graphics,
  Vcl.Controls, Vcl.Forms, Vcl.Dialogs, Vcl.StdCtrls,
  WS_SINGLE_PACK;

type
  TForm1 = class(TForm)
    Button1: TButton;
    Memo1: TMemo;
    procedure Button1Click(Sender: TObject);
  private
    { Private declarations }
  public
    { Public declarations }
  end;

var
  Form1: TForm1;

implementation

{$R *.dfm}

procedure TForm1.Button1Click(Sender: TObject);
var
  WS: ISinglePackServices;
  req: G110Request;
  res: G110Response;

begin
  WS:= GetISinglePackServices;
  req:= G110Request.Create;
  res:= G110Response.Create;

  req.Body.Pack.sn:= '1234';

  res:= WS.G110Verify(req);
end;

end.
Добро пожаловать на сайт PullRequest, где вы можете задавать вопросы и получать ответы от других членов сообщества.
...