Witam zus udostępnił usługę przez Soap do otrzymywania raportów
wygenerowałem zla.pas poniżej
stworzyłem kod i nie wiem co dalej
procedure TForm1.Button1Click(Sender: TObject);
var WebAPI: wsdlPlatnikRaportyZla_PortType;
pyt: Pobierzraporty;
odp: PobierzraportyResponse;
data: Tdatetime;
Datasx: TXSDate;
begin
WebAPI:= GetwsdlPlatnikRaportyZla_PortType(False,'',nil);
pyt:= Pobierzraporty.Create;
odp:= PobierzraportyResponse.Create;
try
pyt.login:='login';
pyt.haslo:='haslo';
pyt.nip:='nip';
pyt.dataOd:=// tu data typu TXSDate
odp:= webapi.pobierzRaporty(pyt);
finally
Memo1.Lines.Add(odp.kod+' '+odp.opis);
pyt.Free;
odp.Free;
end;
proszę o pomoc nie wiem jak zapisać datę w postaci TSXDate
unit zla;
interface
uses Soap.InvokeRegistry, Soap.SOAPHTTPClient, System.Types, Soap.XSBuiltIns;
const
IS_OPTN = $0001;
IS_UNBD = $0002;
IS_NLBL = $0004;
IS_UNQL = $0008;
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.
// ************************************************************************ //
// !:base64Binary - "http://www.w3.org/2001/XMLSchema"[Gbl]
// !:date - "http://www.w3.org/2001/XMLSchema"[Gbl]
// !:string - "http://www.w3.org/2001/XMLSchema"[Gbl]
Raport = class; { "http://zus/zus.channel.platnikRaportyZla:wsdlPlatnikRaportyZla"[GblCplx] }
PobierzRaportyResponse2 = class; { "http://zus/zus.channel.platnikRaportyZla:wsdlPlatnikRaportyZla"[Lit][GblCplx] }
PobierzRaportyResponse = class; { "http://zus/zus.channel.platnikRaportyZla:wsdlPlatnikRaportyZla"[Lit][GblElm] }
PobierzRaporty2 = class; { "http://zus/zus.channel.platnikRaportyZla:wsdlPlatnikRaportyZla"[Lit][GblCplx] }
PobierzRaporty = class; { "http://zus/zus.channel.platnikRaportyZla:wsdlPlatnikRaportyZla"[Lit][GblElm] }
raporty = array of Raport; { "http://zus/zus.channel.platnikRaportyZla:wsdlPlatnikRaportyZla"[GblCplx] }
// ************************************************************************ //
// XML : Raport, global, <complexType>
// Namespace : http://zus/zus.channel.platnikRaportyZla:wsdlPlatnikRaportyZla
// ************************************************************************ //
Raport = class(TRemotable)
private
FdataWygenerowania: TXSDate;
Fzawartosc: TByteDynArray;
public
destructor Destroy; override;
published
property dataWygenerowania: TXSDate Index (IS_UNQL) read FdataWygenerowania write FdataWygenerowania;
property zawartosc: TByteDynArray Index (IS_UNQL) read Fzawartosc write Fzawartosc;
end;
// ************************************************************************ //
// XML : PobierzRaportyResponse, global, <complexType>
// Namespace : http://zus/zus.channel.platnikRaportyZla:wsdlPlatnikRaportyZla
// Serializtn: [xoLiteralParam]
// Info : Wrapper
// ************************************************************************ //
PobierzRaportyResponse2 = class(TRemotable)
private
Fkod: string;
Fopis: string;
Fraporty: raporty;
Fraporty_Specified: boolean;
procedure Setraporty(Index: Integer; const Araporty: raporty);
function raporty_Specified(Index: Integer): boolean;
public
constructor Create; override;
destructor Destroy; override;
published
property kod: string Index (IS_UNQL) read Fkod write Fkod;
property opis: string Index (IS_UNQL) read Fopis write Fopis;
property raporty: raporty Index (IS_OPTN or IS_UNQL) read Fraporty write Setraporty stored raporty_Specified;
end;
// ************************************************************************ //
// XML : PobierzRaportyResponse, global, <element>
// Namespace : http://zus/zus.channel.platnikRaportyZla:wsdlPlatnikRaportyZla
// Info : Wrapper
// ************************************************************************ //
PobierzRaportyResponse = class(PobierzRaportyResponse2)
private
published
end;
// ************************************************************************ //
// XML : PobierzRaporty, global, <complexType>
// Namespace : http://zus/zus.channel.platnikRaportyZla:wsdlPlatnikRaportyZla
// Serializtn: [xoLiteralParam]
// Info : Wrapper
// ************************************************************************ //
PobierzRaporty2 = class(TRemotable)
private
FdataOd: TXSDate;
Flogin: string;
Fhaslo: string;
Fnip: string;
public
constructor Create; override;
destructor Destroy; override;
published
property dataOd: TXSDate Index (IS_UNQL) read FdataOd write FdataOd;
property login: string Index (IS_UNQL) read Flogin write Flogin;
property haslo: string Index (IS_UNQL) read Fhaslo write Fhaslo;
property nip: string Index (IS_NLBL or IS_UNQL) read Fnip write Fnip;
end;
// ************************************************************************ //
// XML : PobierzRaporty, global, <element>
// Namespace : http://zus/zus.channel.platnikRaportyZla:wsdlPlatnikRaportyZla
// Info : Wrapper
// ************************************************************************ //
PobierzRaporty = class(PobierzRaporty2)
private
published
end;
// ************************************************************************ //
// Namespace : http://zus/zus.channel.platnikRaportyZla:wsdlPlatnikRaportyZla
// soapAction: zus_channel_platnikRaportyZla_wsdlPlatnikRaportyZla_Binder_pobierzRaporty
// transport : http://schemas.xmlsoap.org/soap/http
// style : document
// use : literal
// binding : zus_channel_platnikRaportyZla_wsdlPlatnikRaportyZla_Binder
// service : wsdlPlatnikRaportyZla
// port : zus_channel_platnikRaportyZla_wsdlPlatnikRaportyZla_Port
// URL : https://193.105.143.40:8500/ws/zus.channel.platnikRaportyZla:wsdlPlatnikRaportyZla/zus_channel_platnikRaportyZla_wsdlPlatnikRaportyZla_Port
// ************************************************************************ //
wsdlPlatnikRaportyZla_PortType = interface(IInvokable)
['{F5F121D2-9964-4F97-8E11-69C0715B628F}']
// Cannot unwrap:
// - Input element wrapper name does not match operation's name
// - More than one strictly out element was found
function pobierzRaporty(const parameters: PobierzRaporty): PobierzRaportyResponse; stdcall;
end;
function GetwsdlPlatnikRaportyZla_PortType(UseWSDL: Boolean=System.False; Addr: string=''; HTTPRIO: THTTPRIO = nil): wsdlPlatnikRaportyZla_PortType;
implementation
uses System.SysUtils;
function GetwsdlPlatnikRaportyZla_PortType(UseWSDL: Boolean; Addr: string; HTTPRIO: THTTPRIO): wsdlPlatnikRaportyZla_PortType;
const
defWSDL = 'https://193.105.143.40:8500/ws/zus.channel.platnikRaportyZla:wsdlPlatnikRaportyZla/zus_channel_platnikRaportyZla_wsdlPlatnikRaportyZla_Port';
defURL = 'https://193.105.143.40:8500/ws/zus.channel.platnikRaportyZla:wsdlPlatnikRaportyZla/zus_channel_platnikRaportyZla_wsdlPlatnikRaportyZla_Port';
defSvc = 'wsdlPlatnikRaportyZla';
defPrt = 'zus_channel_platnikRaportyZla_wsdlPlatnikRaportyZla_Port';
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 wsdlPlatnikRaportyZla_PortType);
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 Raport.Destroy;
begin
System.SysUtils.FreeAndNil(FdataWygenerowania);
inherited Destroy;
end;
constructor PobierzRaportyResponse2.Create;
begin
inherited Create;
FSerializationOptions := [xoLiteralParam];
end;
destructor PobierzRaportyResponse2.Destroy;
var
I: Integer;
begin
for I := 0 to System.Length(Fraporty)-1 do
System.SysUtils.FreeAndNil(Fraporty[I]);
System.SetLength(Fraporty, 0);
inherited Destroy;
end;
procedure PobierzRaportyResponse2.Setraporty(Index: Integer; const Araporty: raporty);
begin
Fraporty := Araporty;
Fraporty_Specified := True;
end;
function PobierzRaportyResponse2.raporty_Specified(Index: Integer): boolean;
begin
Result := Fraporty_Specified;
end;
constructor PobierzRaporty2.Create;
begin
inherited Create;
FSerializationOptions := [xoLiteralParam];
end;
destructor PobierzRaporty2.Destroy;
begin
System.SysUtils.FreeAndNil(FdataOd);
inherited Destroy;
end;
initialization
{ wsdlPlatnikRaportyZla_PortType }
InvRegistry.RegisterInterface(TypeInfo(wsdlPlatnikRaportyZla_PortType), 'http://zus/zus.channel.platnikRaportyZla:wsdlPlatnikRaportyZla', 'ISO-8859-1');
InvRegistry.RegisterDefaultSOAPAction(TypeInfo(wsdlPlatnikRaportyZla_PortType), 'zus_channel_platnikRaportyZla_wsdlPlatnikRaportyZla_Binder_pobierzRaporty');
InvRegistry.RegisterInvokeOptions(TypeInfo(wsdlPlatnikRaportyZla_PortType), ioDocument);
InvRegistry.RegisterInvokeOptions(TypeInfo(wsdlPlatnikRaportyZla_PortType), ioLiteral);
RemClassRegistry.RegisterXSInfo(TypeInfo(raporty), 'http://zus/zus.channel.platnikRaportyZla:wsdlPlatnikRaportyZla', 'raporty');
RemClassRegistry.RegisterXSClass(Raport, 'http://zus/zus.channel.platnikRaportyZla:wsdlPlatnikRaportyZla', 'Raport');
RemClassRegistry.RegisterXSClass(PobierzRaportyResponse2, 'http://zus/zus.channel.platnikRaportyZla:wsdlPlatnikRaportyZla', 'PobierzRaportyResponse2', 'PobierzRaportyResponse');
RemClassRegistry.RegisterExternalPropName(TypeInfo(PobierzRaportyResponse2), 'raporty', '[ArrayItemName="raport"]');
RemClassRegistry.RegisterSerializeOptions(PobierzRaportyResponse2, [xoLiteralParam]);
RemClassRegistry.RegisterXSClass(PobierzRaportyResponse, 'http://zus/zus.channel.platnikRaportyZla:wsdlPlatnikRaportyZla', 'PobierzRaportyResponse');
RemClassRegistry.RegisterXSClass(PobierzRaporty2, 'http://zus/zus.channel.platnikRaportyZla:wsdlPlatnikRaportyZla', 'PobierzRaporty2', 'PobierzRaporty');
RemClassRegistry.RegisterSerializeOptions(PobierzRaporty2, [xoLiteralParam]);
RemClassRegistry.RegisterXSClass(PobierzRaporty, 'http://zus/zus.channel.platnikRaportyZla:wsdlPlatnikRaportyZla', 'PobierzRaporty');
end.