unit VNifV21;
interface
uses Soap.InvokeRegistry, Soap.SOAPHTTPClient, System.Types, Soap.XSBuiltIns;
const
IS_UNBD = $0002;
type
Contribuyente = class;
Contribuyente2 = class;
VNifV2Sal2 = array of Contribuyente2;
VNifV2Sal = type VNifV2Sal2;
VNifV2Ent2 = array of Contribuyente;
VNifV2Ent = type VNifV2Ent2;
Contribuyente = class(TRemotable)
private
FNif: string;
FNombre: string;
published
property Nif: string read FNif write FNif;
property Nombre: string read FNombre write FNombre;
end;
Contribuyente2 = class(TRemotable)
private
FNif: string;
FNombre: string;
FResultado: string;
published
property Nif: string read FNif write FNif;
property Nombre: string read FNombre write FNombre;
property Resultado: string read FResultado write FResultado;
end;
VNifV2 = interface(IInvokable)
['{0FA68156-DD7D-DED4-F168-3936F989AAA0}']
function VNifV2(const VNifV2Ent: VNifV2Ent): VNifV2Sal; stdcall;
end;
function GetVNifV2(UseWSDL: Boolean=System.False; Addr: string=''; HTTPRIO: THTTPRIO = nil): VNifV2;
implementation
uses System.SysUtils;
function GetVNifV2(UseWSDL: Boolean; Addr: string; HTTPRIO: THTTPRIO): VNifV2;
const
defWSDL = 'https://www2.agenciatributaria.gob.es/static_files/common/internet/dep/aplicaciones/es/aeat/burt/jdit/ws/VNifV2.wsdl';
defURL = 'https://www1.agenciatributaria.gob.es/wlpl/BURT-JDIT/ws/VNifV2SOAP';
defSvc = 'VNifV2Service';
defPrt = 'VNifPort1';
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 VNifV2);
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;
initialization
InvRegistry.RegisterInterface(TypeInfo(VNifV2), 'http://www2.agenciatributaria.gob.es/static_files/common/internet/dep/aplicaciones/es/aeat/burt/jdit/ws/VNifV2.wsdl', 'UTF-8');
InvRegistry.RegisterDefaultSOAPAction(TypeInfo(VNifV2), '');
InvRegistry.RegisterInvokeOptions(TypeInfo(VNifV2), ioDocument);
InvRegistry.RegisterInvokeOptions(TypeInfo(VNifV2), ioLiteral);
RemClassRegistry.RegisterXSInfo(TypeInfo(VNifV2Sal2), 'http://www2.agenciatributaria.gob.es/static_files/common/internet/dep/aplicaciones/es/aeat/burt/jdit/ws/VNifV2Sal.xsd', 'VNifV2Sal2', 'VNifV2Sal');
RemClassRegistry.RegisterSerializeOptions(TypeInfo(VNifV2Sal2), [xoLiteralParam]);
RemClassRegistry.RegisterXSInfo(TypeInfo(VNifV2Sal), 'http://www2.agenciatributaria.gob.es/static_files/common/internet/dep/aplicaciones/es/aeat/burt/jdit/ws/VNifV2Sal.xsd', 'VNifV2Sal');
RemClassRegistry.RegisterXSInfo(TypeInfo(VNifV2Ent2), 'http://www2.agenciatributaria.gob.es/static_files/common/internet/dep/aplicaciones/es/aeat/burt/jdit/ws/VNifV2Ent.xsd', 'VNifV2Ent2', 'VNifV2Ent');
RemClassRegistry.RegisterSerializeOptions(TypeInfo(VNifV2Ent2), [xoLiteralParam]);
RemClassRegistry.RegisterXSInfo(TypeInfo(VNifV2Ent), 'http://www2.agenciatributaria.gob.es/static_files/common/internet/dep/aplicaciones/es/aeat/burt/jdit/ws/VNifV2Ent.xsd', 'VNifV2Ent');
RemClassRegistry.RegisterXSClass(Contribuyente, 'http://www2.agenciatributaria.gob.es/static_files/common/internet/dep/aplicaciones/es/aeat/burt/jdit/ws/VNifV2Ent.xsd', 'Contribuyente');
RemClassRegistry.RegisterXSClass(Contribuyente2, 'http://www2.agenciatributaria.gob.es/static_files/common/internet/dep/aplicaciones/es/aeat/burt/jdit/ws/VNifV2Sal.xsd', 'Contribuyente2', 'Contribuyente');
end.