Всем привет.
На сайте налоговой есть сервис для получения информации о ФИАС.
После обновления сервиса моя программа перестала получать информацию.
Заново импортировал wsdl, но не помогло.
можно скачать описание сервиса - "
https://fias.nalog.ru/Updates"
wsdl сервиса - "
https://fias.nalog.ru/WebServices/Public/DownloadService.asmx"
Сформированный 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.
175.
176.
177.
178.
179.
180.
181.
182.
183.
184.
185.
186.
187.
188.
189.
190.
191.
192.
193.
194.
195.
196.
197.
198.
199.
200.
201.
202.
203.
204.
205.
206.
207.
208.
209.
210.
211.
212.
213.
214.
215.
216.
217.
218.
219.
220.
221.
222.
223.
224.
225.
226.
227.
228.
229.
230.
231.
232.
233.
234.
235.
236.
237.
238.
239.
240.
241.
242.
243.
244.
245.
246.
247.
248.
249.
250.
251.
252.
253.
// ************************************************************************ //
// The types declared in this file were generated from data read from the
// WSDL File described below:
// WSDL : https://fias.nalog.ru/WebServices/Public/DownloadService.asmx
// >Import : https://fias.nalog.ru/WebServices/Public/DownloadService.asmx>0
// Codegen : [wfForceSOAP11+]
// (25.03.2020 11:19:04 - - $Rev: 93209 $)
// ************************************************************************ //
unit DownloadService;
interface
uses Soap.InvokeRegistry, Soap.SOAPHTTPClient, System.Types, Soap.XSBuiltIns;
const
IS_OPTN = $0001;
IS_UNBD = $0002;
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.
// ************************************************************************ //
// !:long - "http://www.w3.org/2001/XMLSchema"[Gbl]
// !:string - "http://www.w3.org/2001/XMLSchema"[Gbl]
DownloadFileInfo2 = class; { "https://fias.nalog.ru/WebServices/Public/DownloadService.asmx/"[GblCplx] }
DownloadFileInfo = class; { "https://fias.nalog.ru/WebServices/Public/DownloadService.asmx/"[GblElm] }
ArrayOfDownloadFileInfo = array of DownloadFileInfo2; { "https://fias.nalog.ru/WebServices/Public/DownloadService.asmx/"[GblCplx] }
// ************************************************************************ //
// XML : DownloadFileInfo, global, <complexType>
// Namespace : https://fias.nalog.ru/WebServices/Public/DownloadService.asmx/
// ************************************************************************ //
DownloadFileInfo2 = class(TRemotable)
private
FVersionId: Int64;
FTextVersion: string;
FTextVersion_Specified: boolean;
FFiasCompleteDbfUrl: string;
FFiasCompleteDbfUrl_Specified: boolean;
FFiasCompleteXmlUrl: string;
FFiasCompleteXmlUrl_Specified: boolean;
FFiasDeltaDbfUrl: string;
FFiasDeltaDbfUrl_Specified: boolean;
FFiasDeltaXmlUrl: string;
FFiasDeltaXmlUrl_Specified: boolean;
FKladr4ArjUrl: string;
FKladr4ArjUrl_Specified: boolean;
FKladr47ZUrl: string;
FKladr47ZUrl_Specified: boolean;
procedure SetTextVersion(Index: Integer; const Astring: string);
function TextVersion_Specified(Index: Integer): boolean;
procedure SetFiasCompleteDbfUrl(Index: Integer; const Astring: string);
function FiasCompleteDbfUrl_Specified(Index: Integer): boolean;
procedure SetFiasCompleteXmlUrl(Index: Integer; const Astring: string);
function FiasCompleteXmlUrl_Specified(Index: Integer): boolean;
procedure SetFiasDeltaDbfUrl(Index: Integer; const Astring: string);
function FiasDeltaDbfUrl_Specified(Index: Integer): boolean;
procedure SetFiasDeltaXmlUrl(Index: Integer; const Astring: string);
function FiasDeltaXmlUrl_Specified(Index: Integer): boolean;
procedure SetKladr4ArjUrl(Index: Integer; const Astring: string);
function Kladr4ArjUrl_Specified(Index: Integer): boolean;
procedure SetKladr47ZUrl(Index: Integer; const Astring: string);
function Kladr47ZUrl_Specified(Index: Integer): boolean;
published
property VersionId: Int64 read FVersionId write FVersionId;
property TextVersion: string Index (IS_OPTN) read FTextVersion write SetTextVersion stored TextVersion_Specified;
property FiasCompleteDbfUrl: string Index (IS_OPTN) read FFiasCompleteDbfUrl write SetFiasCompleteDbfUrl stored FiasCompleteDbfUrl_Specified;
property FiasCompleteXmlUrl: string Index (IS_OPTN) read FFiasCompleteXmlUrl write SetFiasCompleteXmlUrl stored FiasCompleteXmlUrl_Specified;
property FiasDeltaDbfUrl: string Index (IS_OPTN) read FFiasDeltaDbfUrl write SetFiasDeltaDbfUrl stored FiasDeltaDbfUrl_Specified;
property FiasDeltaXmlUrl: string Index (IS_OPTN) read FFiasDeltaXmlUrl write SetFiasDeltaXmlUrl stored FiasDeltaXmlUrl_Specified;
property Kladr4ArjUrl: string Index (IS_OPTN) read FKladr4ArjUrl write SetKladr4ArjUrl stored Kladr4ArjUrl_Specified;
property Kladr47ZUrl: string Index (IS_OPTN) read FKladr47ZUrl write SetKladr47ZUrl stored Kladr47ZUrl_Specified;
end;
// ************************************************************************ //
// XML : DownloadFileInfo, global, <element>
// Namespace : https://fias.nalog.ru/WebServices/Public/DownloadService.asmx/
// ************************************************************************ //
DownloadFileInfo = class(DownloadFileInfo2)
private
published
end;
// ************************************************************************ //
// Namespace : https://fias.nalog.ru/WebServices/Public/DownloadService.asmx/
// soapAction: https://fias.nalog.ru/WebServices/Public/DownloadService.asmx/%operationName%
// transport : http://schemas.xmlsoap.org/soap/http
// style : document
// use : literal
// binding : BasicHttpBinding_IDownloadService
// service : IDownloadService
// port : BasicHttpBinding_IDownloadService
// URL : http://fias.nalog.ru/WebServices/Public/DownloadService.asmx
// ************************************************************************ //
IDownloadService = interface(IInvokable)
['{27E074B3-E3FF-E889-D5C3-0B968A60AE64}']
function GetAllDownloadFileInfo: ArrayOfDownloadFileInfo; stdcall;
function GetLastDownloadFileInfo: DownloadFileInfo2; stdcall;
end;
function GetIDownloadService(UseWSDL: Boolean=System.False; Addr: string=''; HTTPRIO: THTTPRIO = nil): IDownloadService;
implementation
uses System.SysUtils;
function GetIDownloadService(UseWSDL: Boolean; Addr: string; HTTPRIO: THTTPRIO): IDownloadService;
const
defWSDL = 'https://fias.nalog.ru/WebServices/Public/DownloadService.asmx';
defURL = 'http://fias.nalog.ru/WebServices/Public/DownloadService.asmx';
defSvc = 'IDownloadService';
defPrt = 'BasicHttpBinding_IDownloadService';
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 IDownloadService);
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 DownloadFileInfo2.SetTextVersion(Index: Integer; const Astring: string);
begin
FTextVersion := Astring;
FTextVersion_Specified := True;
end;
function DownloadFileInfo2.TextVersion_Specified(Index: Integer): boolean;
begin
Result := FTextVersion_Specified;
end;
procedure DownloadFileInfo2.SetFiasCompleteDbfUrl(Index: Integer; const Astring: string);
begin
FFiasCompleteDbfUrl := Astring;
FFiasCompleteDbfUrl_Specified := True;
end;
function DownloadFileInfo2.FiasCompleteDbfUrl_Specified(Index: Integer): boolean;
begin
Result := FFiasCompleteDbfUrl_Specified;
end;
procedure DownloadFileInfo2.SetFiasCompleteXmlUrl(Index: Integer; const Astring: string);
begin
FFiasCompleteXmlUrl := Astring;
FFiasCompleteXmlUrl_Specified := True;
end;
function DownloadFileInfo2.FiasCompleteXmlUrl_Specified(Index: Integer): boolean;
begin
Result := FFiasCompleteXmlUrl_Specified;
end;
procedure DownloadFileInfo2.SetFiasDeltaDbfUrl(Index: Integer; const Astring: string);
begin
FFiasDeltaDbfUrl := Astring;
FFiasDeltaDbfUrl_Specified := True;
end;
function DownloadFileInfo2.FiasDeltaDbfUrl_Specified(Index: Integer): boolean;
begin
Result := FFiasDeltaDbfUrl_Specified;
end;
procedure DownloadFileInfo2.SetFiasDeltaXmlUrl(Index: Integer; const Astring: string);
begin
FFiasDeltaXmlUrl := Astring;
FFiasDeltaXmlUrl_Specified := True;
end;
function DownloadFileInfo2.FiasDeltaXmlUrl_Specified(Index: Integer): boolean;
begin
Result := FFiasDeltaXmlUrl_Specified;
end;
procedure DownloadFileInfo2.SetKladr4ArjUrl(Index: Integer; const Astring: string);
begin
FKladr4ArjUrl := Astring;
FKladr4ArjUrl_Specified := True;
end;
function DownloadFileInfo2.Kladr4ArjUrl_Specified(Index: Integer): boolean;
begin
Result := FKladr4ArjUrl_Specified;
end;
procedure DownloadFileInfo2.SetKladr47ZUrl(Index: Integer; const Astring: string);
begin
FKladr47ZUrl := Astring;
FKladr47ZUrl_Specified := True;
end;
function DownloadFileInfo2.Kladr47ZUrl_Specified(Index: Integer): boolean;
begin
Result := FKladr47ZUrl_Specified;
end;
initialization
{ IDownloadService }
InvRegistry.RegisterInterface(TypeInfo(IDownloadService), 'https://fias.nalog.ru/WebServices/Public/DownloadService.asmx/', '');
InvRegistry.RegisterDefaultSOAPAction(TypeInfo(IDownloadService), 'https://fias.nalog.ru/WebServices/Public/DownloadService.asmx/%operationName%');
InvRegistry.RegisterInvokeOptions(TypeInfo(IDownloadService), ioDocument);
{ IDownloadService.GetAllDownloadFileInfo }
InvRegistry.RegisterMethodInfo(TypeInfo(IDownloadService), 'GetAllDownloadFileInfo', '',
'[ReturnName="GetAllDownloadFileInfoResult"]', IS_OPTN or IS_NLBL);
InvRegistry.RegisterParamInfo(TypeInfo(IDownloadService), 'GetAllDownloadFileInfo', 'GetAllDownloadFileInfoResult', '',
'[ArrayItemName="DownloadFileInfo"]', IS_NLBL);
{ IDownloadService.GetLastDownloadFileInfo }
InvRegistry.RegisterMethodInfo(TypeInfo(IDownloadService), 'GetLastDownloadFileInfo', '',
'[ReturnName="GetLastDownloadFileInfoResult"]', IS_OPTN);
RemClassRegistry.RegisterXSInfo(TypeInfo(ArrayOfDownloadFileInfo), 'https://fias.nalog.ru/WebServices/Public/DownloadService.asmx/', 'ArrayOfDownloadFileInfo');
RemClassRegistry.RegisterXSClass(DownloadFileInfo2, 'https://fias.nalog.ru/WebServices/Public/DownloadService.asmx/', 'DownloadFileInfo2', 'DownloadFileInfo');
RemClassRegistry.RegisterXSClass(DownloadFileInfo, 'https://fias.nalog.ru/WebServices/Public/DownloadService.asmx/', 'DownloadFileInfo');
end.
Пример вызова:
1.
2.
3.
4.
5.
6.
7.
var
soap: IDownloadService;
VersionId: Int64;
begin
soap := GetIDownloadService;
VersionId := soap.GetLastDownloadFileInfo.VersionId; // <-- Ошибка!!!
end;
Ошибка:
1.
2.
3.
4.
5.
6.
7.
---------------------------
Debugger Exception Notification
---------------------------
Project Project2.exe raised exception class ESOAPDomConvertError with message 'DocumentElement http://schemas.xmlsoap.org/soap/envelope/:Envelope expected, http://schemas.xmlsoap.org/wsdl/:definitions found'.
---------------------------
Break Continue Help
---------------------------
Пример DownloadService.pas c сформированным api сервиса прикрепил.
Может кто поможет, как исправить?
Спасибо.