-
Notifications
You must be signed in to change notification settings - Fork 44
/
Copy pathFacturacion.ConsultaCFDI.WebService.pas
174 lines (150 loc) · 7.1 KB
/
Facturacion.ConsultaCFDI.WebService.pas
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
168
169
170
171
172
173
174
// ************************************************************************ //
// The types declared in this file were generated from data read from the
// WSDL File described below:
// WSDL : https://consultaqr.facturaelectronica.sat.gob.mx/ConsultaCFDIService.svc?wsdl
// >Import : https://consultaqr.facturaelectronica.sat.gob.mx/ConsultaCFDIService.svc?wsdl>0
// >Import : https://consultaqr.facturaelectronica.sat.gob.mx/ConsultaCFDIService.svc?xsd=xsd0
// >Import : https://consultaqr.facturaelectronica.sat.gob.mx/ConsultaCFDIService.svc?xsd=xsd2
// >Import : https://consultaqr.facturaelectronica.sat.gob.mx/ConsultaCFDIService.svc?xsd=xsd1
// Encoding : utf-8
// Version : 1.0
// (10/10/2018 11:31:45 a. m. - - $Rev: 76228 $)
// ************************************************************************ //
unit Facturacion.ConsultaCFDI.WebService;
interface
uses Soap.InvokeRegistry, Soap.SOAPHTTPClient, System.Types, Soap.XSBuiltIns;
const
IS_OPTN = $0001;
IS_NLBL = $0004;
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 Embarcadero types; however, they could also
// indicate incorrect WSDL documents that failed to declare or import a schema type.
// ************************************************************************ //
// !:string - "http://www.w3.org/2001/XMLSchema"[Gbl]
TAcuseConsultaCFDI = class; { "http://schemas.datacontract.org/2004/07/Sat.Cfdi.Negocio.ConsultaCfdi.Servicio"[GblElm] }
// ************************************************************************ //
// XML : TAcuseConsultaCFDI, global, <complexType>
// Namespace : http://schemas.datacontract.org/2004/07/Sat.Cfdi.Negocio.ConsultaCfdi.Servicio
// ************************************************************************ //
TAcuseConsultaCFDI = class(TRemotable)
private
FCodigoEstatus: string;
FCodigoEstatus_Specified: boolean;
FEstado: string;
fEstatusCancelacion: String;
fEstatusCancelacion_Specified : Boolean;
FEstado_Specified: boolean;
fEsCancelable: String;
procedure SetCodigoEstatus(Index: Integer; const Astring: string);
function CodigoEstatus_Specified(Index: Integer): boolean;
procedure SetEstado(Index: Integer; const Astring: string);
procedure SetEstatusCancelacion(Index: Integer; const Astring: string);
function Estado_Specified(Index: Integer): boolean;
function EstatusCancelacion_Specified(Index: Integer): Boolean;
published
property CodigoEstatus: string Index (IS_OPTN or IS_NLBL) read FCodigoEstatus write SetCodigoEstatus stored CodigoEstatus_Specified;
property Estado: string Index (IS_OPTN or IS_NLBL) read FEstado write SetEstado stored Estado_Specified;
property EsCancelable: String Index (IS_OPTN or IS_NLBL) read fEsCancelable write fEsCancelable;
property EstatusCancelacion: string Index (IS_OPTN or IS_NLBL) read fEstatusCancelacion write SetEstatusCancelacion stored EstatusCancelacion_Specified;
end;
// ************************************************************************ //
// Namespace : http://tempuri.org/
// soapAction: http://tempuri.org/IConsultaCFDIWebService/Consulta
// transport : http://schemas.xmlsoap.org/soap/http
// style : document
// use : literal
// binding : BasicHttpBinding_IConsultaCFDIService
// service : ConsultaCFDIService
// port : BasicHttpBinding_IConsultaCFDIService
// URL : https://consultaqr.facturaelectronica.sat.gob.mx/ConsultaCFDIService.svc
// ************************************************************************ //
IConsultaCFDIWebService = interface(IInvokable)
['{4DF23DD6-082D-EA7B-1ED2-F90B5634558F}']
function Consulta(const expresionImpresa: string): TAcuseConsultaCFDI; stdcall;
end;
function GetConsultaCFDIWebService(UseWSDL: Boolean=System.False; Addr:
string=''; HTTPRIO: THTTPRIO = nil): IConsultaCFDIWebService;
implementation
uses System.SysUtils;
function GetConsultaCFDIWebService(UseWSDL: Boolean=System.False; Addr:
string=''; HTTPRIO: THTTPRIO = nil): IConsultaCFDIWebService;
const
defWSDL = 'https://consultaqr.facturaelectronica.sat.gob.mx/ConsultaCFDIService.svc?wsdl';
defURL = 'https://consultaqr.facturaelectronica.sat.gob.mx/ConsultaCFDIService.svc';
defSvc = 'ConsultaCFDIService';
defPrt = 'BasicHttpBinding_IConsultaCFDIService';
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 IConsultaCFDIWebService);
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;
procedure TAcuseConsultaCFDI.SetCodigoEstatus(Index: Integer; const Astring: string);
begin
FCodigoEstatus := Astring;
FCodigoEstatus_Specified := True;
end;
function TAcuseConsultaCFDI.CodigoEstatus_Specified(Index: Integer): boolean;
begin
Result := FCodigoEstatus_Specified;
end;
procedure TAcuseConsultaCFDI.SetEstado(Index: Integer; const Astring: string);
begin
FEstado := Astring;
FEstado_Specified := True;
end;
procedure TAcuseConsultaCFDI.SetEstatusCancelacion(Index: Integer; const Astring: string);
begin
fEstatusCancelacion := Astring;
fEstatusCancelacion_Specified := True;
end;
function TAcuseConsultaCFDI.Estado_Specified(Index: Integer): boolean;
begin
Result := FEstado_Specified;
end;
function TAcuseConsultaCFDI.EstatusCancelacion_Specified(Index: Integer): Boolean;
begin
Result := fEstatusCancelacion_Specified;
end;
initialization
{ IConsultaCFDIWebService }
InvRegistry.RegisterInterface(TypeInfo(IConsultaCFDIWebService), 'http://tempuri.org/', 'utf-8');
InvRegistry.RegisterDefaultSOAPAction(TypeInfo(IConsultaCFDIWebService), 'http://tempuri.org/IConsultaCFDIService/Consulta');
InvRegistry.RegisterInvokeOptions(TypeInfo(IConsultaCFDIWebService), ioDocument);
{ IConsultaCFDIWebService.Consulta }
InvRegistry.RegisterMethodInfo(TypeInfo(IConsultaCFDIWebService), 'Consulta', '',
'[ReturnName="ConsultaResult"]', IS_OPTN or IS_NLBL);
InvRegistry.RegisterParamInfo(TypeInfo(IConsultaCFDIWebService), 'Consulta', 'expresionImpresa', '',
'', IS_NLBL);
InvRegistry.RegisterParamInfo(TypeInfo(IConsultaCFDIWebService), 'Consulta', 'ConsultaResult', '',
'[Namespace="http://schemas.datacontract.org/2004/07/Sat.Cfdi.Negocio.ConsultaCfdi.Servicio"]', IS_NLBL);
RemClassRegistry.RegisterXSClass(TAcuseConsultaCFDI, 'http://schemas.datacontract.org/2004/07/Sat.Cfdi.Negocio.ConsultaCfdi.Servicio', 'Acuse');
end.