Dla potomnych:
Po ściągnięciu poprawki, należy użyć polecenia (dla wersji testowej):
WSDLImp.exe -p https://test-bramka.edeklaracje.gov.pl/uslugi/dokumenty?wsdl
A oto wygenerowany plik, jeżeli komuś nie pójdzie.
// ************************************************************************ //
// The types declared in this file were generated from data read from the
// WSDL File described below:
// WSDL : https://test-bramka.edeklaracje.gov.pl/uslugi/dokumenty?wsdl
// >Import : https://test-bramka.edeklaracje.gov.pl/uslugi/dokumenty?wsdl:0
// >Import : https://test-bramka.edeklaracje.gov.pl/uslugi/GateService?xsd=GateService.xsd
// Encoding : UTF-8
// Version : 1.0
// (2014-06-10 13:30:51 - - $Rev: 10138 $)
// ************************************************************************ //
unit GateService_test;
interface
uses InvokeRegistry, SOAPHTTPClient, Types, XSBuiltIns;
const
IS_OPTN = $0001;
IS_REF = $0080;
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 Borland 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]
// !:string - "http://www.w3.org/2001/XMLSchema"[Gbl]
// !:int - "http://www.w3.org/2001/XMLSchema"[Gbl]
sendDocument = class; { "https://bramka.e-deklaracje.mf.gov.pl/xsd"[Lit][GblElm] }
sendDocumentResponse = class; { "https://bramka.e-deklaracje.mf.gov.pl/xsd"[Lit][GblElm] }
sendUnsignDocument = class; { "https://bramka.e-deklaracje.mf.gov.pl/xsd"[Lit][GblElm] }
sendUnsignDocumentResponse = class; { "https://bramka.e-deklaracje.mf.gov.pl/xsd"[Lit][GblElm] }
sendDocumentWithAttachment = class; { "https://bramka.e-deklaracje.mf.gov.pl/xsd"[Lit][GblElm] }
sendDocumentWithAttachmentResponse = class; { "https://bramka.e-deklaracje.mf.gov.pl/xsd"[Lit][GblElm] }
requestUPO = class; { "https://bramka.e-deklaracje.mf.gov.pl/xsd"[Lit][GblElm] }
requestUPOResponse = class; { "https://bramka.e-deklaracje.mf.gov.pl/xsd"[Lit][GblElm] }
{ "https://bramka.e-deklaracje.mf.gov.pl/xsd"[Smpl] }
language = (de, en, pl);
{ "https://bramka.e-deklaracje.mf.gov.pl/xsd"[Smpl] }
signatureType = (PIT, MPO);
{ "https://bramka.e-deklaracje.mf.gov.pl/xsd"[Smpl] }
language2 = (de2, en2, pl2);
// ************************************************************************ //
// XML : sendDocument, global, <element>
// Namespace : https://bramka.e-deklaracje.mf.gov.pl/xsd
// Serializtn: [xoLiteralParam]
// Info : Wrapper
// ************************************************************************ //
sendDocument = class(TRemotable)
private
Fdocument: TByteDynArray;
public
constructor Create; override;
published
property document: TByteDynArray read Fdocument write Fdocument;
end;
// ************************************************************************ //
// XML : sendDocumentResponse, global, <element>
// Namespace : https://bramka.e-deklaracje.mf.gov.pl/xsd
// Serializtn: [xoLiteralParam]
// Info : Wrapper
// ************************************************************************ //
sendDocumentResponse = class(TRemotable)
private
FrefId: WideString;
FrefId_Specified: boolean;
Fstatus: Integer;
FstatusOpis: WideString;
procedure SetrefId(Index: Integer; const AWideString: WideString);
function refId_Specified(Index: Integer): boolean;
public
constructor Create; override;
published
property refId: WideString Index (IS_OPTN) read FrefId write SetrefId stored refId_Specified;
property status: Integer read Fstatus write Fstatus;
property statusOpis: WideString read FstatusOpis write FstatusOpis;
end;
// ************************************************************************ //
// XML : sendUnsignDocument, global, <element>
// Namespace : https://bramka.e-deklaracje.mf.gov.pl/xsd
// Serializtn: [xoLiteralParam]
// Info : Wrapper
// ************************************************************************ //
sendUnsignDocument = class(TRemotable)
private
Fdocument: TByteDynArray;
Flanguage: language;
Flanguage_Specified: boolean;
FsignatureType: signatureType;
FsignatureType_Specified: boolean;
procedure Setlanguage(Index: Integer; const Alanguage: language);
function language_Specified(Index: Integer): boolean;
procedure SetsignatureType(Index: Integer; const AsignatureType: signatureType);
function signatureType_Specified(Index: Integer): boolean;
public
constructor Create; override;
published
property document: TByteDynArray read Fdocument write Fdocument;
property language: language Index (IS_OPTN) read Flanguage write Setlanguage stored language_Specified;
property signatureType: signatureType Index (IS_OPTN) read FsignatureType write SetsignatureType stored signatureType_Specified;
end;
// ************************************************************************ //
// XML : sendUnsignDocumentResponse, global, <element>
// Namespace : https://bramka.e-deklaracje.mf.gov.pl/xsd
// Serializtn: [xoLiteralParam]
// Info : Wrapper
// ************************************************************************ //
sendUnsignDocumentResponse = class(TRemotable)
private
FrefId: WideString;
FrefId_Specified: boolean;
Fstatus: Integer;
FstatusOpis: WideString;
procedure SetrefId(Index: Integer; const AWideString: WideString);
function refId_Specified(Index: Integer): boolean;
public
constructor Create; override;
published
property refId: WideString Index (IS_OPTN) read FrefId write SetrefId stored refId_Specified;
property status: Integer read Fstatus write Fstatus;
property statusOpis: WideString read FstatusOpis write FstatusOpis;
end;
// ************************************************************************ //
// XML : sendDocumentWithAttachment, global, <element>
// Namespace : https://bramka.e-deklaracje.mf.gov.pl/xsd
// Serializtn: [xoLiteralParam]
// Info : Wrapper
// ************************************************************************ //
sendDocumentWithAttachment = class(TRemotable)
private
Fattachment: TByteDynArray;
Fattachment_Specified: boolean;
Fdocument: TByteDynArray;
procedure Setattachment(Index: Integer; const ATByteDynArray: TByteDynArray);
function attachment_Specified(Index: Integer): boolean;
public
constructor Create; override;
published
property attachment: TByteDynArray Index (IS_OPTN) read Fattachment write Setattachment stored attachment_Specified;
property document: TByteDynArray read Fdocument write Fdocument;
end;
// ************************************************************************ //
// XML : sendDocumentWithAttachmentResponse, global, <element>
// Namespace : https://bramka.e-deklaracje.mf.gov.pl/xsd
// Serializtn: [xoLiteralParam]
// Info : Wrapper
// ************************************************************************ //
sendDocumentWithAttachmentResponse = class(TRemotable)
private
FrefId: WideString;
FrefId_Specified: boolean;
Fstatus: Integer;
FstatusOpis: WideString;
procedure SetrefId(Index: Integer; const AWideString: WideString);
function refId_Specified(Index: Integer): boolean;
public
constructor Create; override;
published
property refId: WideString Index (IS_OPTN) read FrefId write SetrefId stored refId_Specified;
property status: Integer read Fstatus write Fstatus;
property statusOpis: WideString read FstatusOpis write FstatusOpis;
end;
// ************************************************************************ //
// XML : requestUPO, global, <element>
// Namespace : https://bramka.e-deklaracje.mf.gov.pl/xsd
// Serializtn: [xoLiteralParam]
// Info : Wrapper
// ************************************************************************ //
requestUPO = class(TRemotable)
private
FrefId: WideString;
Flanguage: language2;
Flanguage_Specified: boolean;
procedure Setlanguage(Index: Integer; const Alanguage2: language2);
function language_Specified(Index: Integer): boolean;
public
constructor Create; override;
published
property refId: WideString read FrefId write FrefId;
property language: language2 Index (IS_OPTN) read Flanguage write Setlanguage stored language_Specified;
end;
// ************************************************************************ //
// XML : requestUPOResponse, global, <element>
// Namespace : https://bramka.e-deklaracje.mf.gov.pl/xsd
// Serializtn: [xoLiteralParam]
// Info : Wrapper
// ************************************************************************ //
requestUPOResponse = class(TRemotable)
private
Fupo: WideString;
Fupo_Specified: boolean;
Fstatus: Integer;
FstatusOpis: WideString;
procedure Setupo(Index: Integer; const AWideString: WideString);
function upo_Specified(Index: Integer): boolean;
public
constructor Create; override;
published
property upo: WideString Index (IS_OPTN) read Fupo write Setupo stored upo_Specified;
property status: Integer read Fstatus write Fstatus;
property statusOpis: WideString read FstatusOpis write FstatusOpis;
end;
// ************************************************************************ //
// Namespace : https://bramka.e-deklaracje.mf.gov.pl/
// soapAction: urn:%operationName%
// transport : http://schemas.xmlsoap.org/soap/http
// style : document
// binding : GateServiceSOAP11Binding
// service : GateService
// port : GateServiceSOAP11port
// URL : https://test-bramka.edeklaracje.gov.pl/uslugi/dokumenty/
// ************************************************************************ //
GateServicePortType = interface(IInvokable)
['{58886444-F106-2A9D-2B76-CAAFE9477074}']
// Cannot unwrap:
// - More than one strictly out element was found
function sendDocument(const part1: sendDocument): sendDocumentResponse; stdcall;
// Cannot unwrap:
// - More than one strictly out element was found
function sendUnsignDocument(const part1: sendUnsignDocument): sendUnsignDocumentResponse; stdcall;
// Cannot unwrap:
// - More than one strictly out element was found
function sendDocumentWithAttachment(const part1: sendDocumentWithAttachment): sendDocumentWithAttachmentResponse; stdcall;
// Cannot unwrap:
// - More than one strictly out element was found
function requestUPO(const part1: requestUPO): requestUPOResponse; stdcall;
end;
function GetGateServicePortType(UseWSDL: Boolean=System.False; Addr: string=''; HTTPRIO: THTTPRIO = nil): GateServicePortType;
implementation
uses SysUtils;
function GetGateServicePortType(UseWSDL: Boolean; Addr: string; HTTPRIO: THTTPRIO): GateServicePortType;
const
defWSDL = 'https://test-bramka.edeklaracje.gov.pl/uslugi/dokumenty?wsdl';
defURL = 'https://test-bramka.edeklaracje.gov.pl/uslugi/dokumenty/';
defSvc = 'GateService';
defPrt = 'GateServiceSOAP11port';
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 GateServicePortType);
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;
constructor sendDocument.Create;
begin
inherited Create;
FSerializationOptions := [xoLiteralParam];
end;
constructor sendDocumentResponse.Create;
begin
inherited Create;
FSerializationOptions := [xoLiteralParam];
end;
procedure sendDocumentResponse.SetrefId(Index: Integer; const AWideString: WideString);
begin
FrefId := AWideString;
FrefId_Specified := True;
end;
function sendDocumentResponse.refId_Specified(Index: Integer): boolean;
begin
Result := FrefId_Specified;
end;
constructor sendUnsignDocument.Create;
begin
inherited Create;
FSerializationOptions := [xoLiteralParam];
end;
procedure sendUnsignDocument.Setlanguage(Index: Integer; const Alanguage: language);
begin
Flanguage := Alanguage;
Flanguage_Specified := True;
end;
function sendUnsignDocument.language_Specified(Index: Integer): boolean;
begin
Result := Flanguage_Specified;
end;
procedure sendUnsignDocument.SetsignatureType(Index: Integer; const AsignatureType: signatureType);
begin
FsignatureType := AsignatureType;
FsignatureType_Specified := True;
end;
function sendUnsignDocument.signatureType_Specified(Index: Integer): boolean;
begin
Result := FsignatureType_Specified;
end;
constructor sendUnsignDocumentResponse.Create;
begin
inherited Create;
FSerializationOptions := [xoLiteralParam];
end;
procedure sendUnsignDocumentResponse.SetrefId(Index: Integer; const AWideString: WideString);
begin
FrefId := AWideString;
FrefId_Specified := True;
end;
function sendUnsignDocumentResponse.refId_Specified(Index: Integer): boolean;
begin
Result := FrefId_Specified;
end;
constructor sendDocumentWithAttachment.Create;
begin
inherited Create;
FSerializationOptions := [xoLiteralParam];
end;
procedure sendDocumentWithAttachment.Setattachment(Index: Integer; const ATByteDynArray: TByteDynArray);
begin
Fattachment := ATByteDynArray;
Fattachment_Specified := True;
end;
function sendDocumentWithAttachment.attachment_Specified(Index: Integer): boolean;
begin
Result := Fattachment_Specified;
end;
constructor sendDocumentWithAttachmentResponse.Create;
begin
inherited Create;
FSerializationOptions := [xoLiteralParam];
end;
procedure sendDocumentWithAttachmentResponse.SetrefId(Index: Integer; const AWideString: WideString);
begin
FrefId := AWideString;
FrefId_Specified := True;
end;
function sendDocumentWithAttachmentResponse.refId_Specified(Index: Integer): boolean;
begin
Result := FrefId_Specified;
end;
constructor requestUPO.Create;
begin
inherited Create;
FSerializationOptions := [xoLiteralParam];
end;
procedure requestUPO.Setlanguage(Index: Integer; const Alanguage2: language2);
begin
Flanguage := Alanguage2;
Flanguage_Specified := True;
end;
function requestUPO.language_Specified(Index: Integer): boolean;
begin
Result := Flanguage_Specified;
end;
constructor requestUPOResponse.Create;
begin
inherited Create;
FSerializationOptions := [xoLiteralParam];
end;
procedure requestUPOResponse.Setupo(Index: Integer; const AWideString: WideString);
begin
Fupo := AWideString;
Fupo_Specified := True;
end;
function requestUPOResponse.upo_Specified(Index: Integer): boolean;
begin
Result := Fupo_Specified;
end;
initialization
InvRegistry.RegisterInterface(TypeInfo(GateServicePortType), 'https://bramka.e-deklaracje.mf.gov.pl/', 'UTF-8');
InvRegistry.RegisterDefaultSOAPAction(TypeInfo(GateServicePortType), 'urn:%operationName%');
InvRegistry.RegisterInvokeOptions(TypeInfo(GateServicePortType), ioDocument);
InvRegistry.RegisterInvokeOptions(TypeInfo(GateServicePortType), ioLiteral);
InvRegistry.RegisterExternalParamName(TypeInfo(GateServicePortType), 'sendDocument', 'part11', 'part1');
InvRegistry.RegisterExternalParamName(TypeInfo(GateServicePortType), 'sendUnsignDocument', 'part11', 'part1');
InvRegistry.RegisterExternalParamName(TypeInfo(GateServicePortType), 'sendDocumentWithAttachment', 'part11', 'part1');
InvRegistry.RegisterExternalParamName(TypeInfo(GateServicePortType), 'requestUPO', 'part11', 'part1');
RemClassRegistry.RegisterXSClass(sendDocument, 'https://bramka.e-deklaracje.mf.gov.pl/xsd', 'sendDocument');
RemClassRegistry.RegisterSerializeOptions(sendDocument, [xoLiteralParam]);
RemClassRegistry.RegisterXSClass(sendDocumentResponse, 'https://bramka.e-deklaracje.mf.gov.pl/xsd', 'sendDocumentResponse');
RemClassRegistry.RegisterSerializeOptions(sendDocumentResponse, [xoLiteralParam]);
RemClassRegistry.RegisterXSInfo(TypeInfo(language), 'https://bramka.e-deklaracje.mf.gov.pl/xsd', 'language');
RemClassRegistry.RegisterXSInfo(TypeInfo(signatureType), 'https://bramka.e-deklaracje.mf.gov.pl/xsd', 'signatureType');
RemClassRegistry.RegisterXSClass(sendUnsignDocument, 'https://bramka.e-deklaracje.mf.gov.pl/xsd', 'sendUnsignDocument');
RemClassRegistry.RegisterSerializeOptions(sendUnsignDocument, [xoLiteralParam]);
RemClassRegistry.RegisterXSClass(sendUnsignDocumentResponse, 'https://bramka.e-deklaracje.mf.gov.pl/xsd', 'sendUnsignDocumentResponse');
RemClassRegistry.RegisterSerializeOptions(sendUnsignDocumentResponse, [xoLiteralParam]);
RemClassRegistry.RegisterXSClass(sendDocumentWithAttachment, 'https://bramka.e-deklaracje.mf.gov.pl/xsd', 'sendDocumentWithAttachment');
RemClassRegistry.RegisterSerializeOptions(sendDocumentWithAttachment, [xoLiteralParam]);
RemClassRegistry.RegisterXSClass(sendDocumentWithAttachmentResponse, 'https://bramka.e-deklaracje.mf.gov.pl/xsd', 'sendDocumentWithAttachmentResponse');
RemClassRegistry.RegisterSerializeOptions(sendDocumentWithAttachmentResponse, [xoLiteralParam]);
RemClassRegistry.RegisterXSInfo(TypeInfo(language2), 'https://bramka.e-deklaracje.mf.gov.pl/xsd', 'language2', 'language');
RemClassRegistry.RegisterExternalPropName(TypeInfo(language2), 'de2', 'de');
RemClassRegistry.RegisterExternalPropName(TypeInfo(language2), 'en2', 'en');
RemClassRegistry.RegisterExternalPropName(TypeInfo(language2), 'pl2', 'pl');
RemClassRegistry.RegisterXSClass(requestUPO, 'https://bramka.e-deklaracje.mf.gov.pl/xsd', 'requestUPO');
RemClassRegistry.RegisterSerializeOptions(requestUPO, [xoLiteralParam]);
RemClassRegistry.RegisterXSClass(requestUPOResponse, 'https://bramka.e-deklaracje.mf.gov.pl/xsd', 'requestUPOResponse');
RemClassRegistry.RegisterSerializeOptions(requestUPOResponse, [xoLiteralParam]);
end.