Здравствуйте! Пытаюсь в проекте использовать xml data binding wizard. Есть xsd, генерирую по нему интерфейсы. При попытке вызвать функцию загрузки xml из файла выдает данную ошибку(interface not supported). Вроде всё правильно и xml в utf8.
вторая страница генерации интерфейсов в xml data binding wizard в прикрепленном файле.
код проверки:
1.
2.
3.
4.
5.
6.
7.
8.
9.
procedure TForm1.Button1Click(Sender: TObject);
var
xml607: IXMLAccept_notification;
begin
...
//строка ниже вызывает ошибку
xml607 := Loadaccept_notification('607_01.xml');
...
end;
xml:
1.
2.
3.
4.
5.
6.
7.
8.
9.
10.
11.
12.
13.
14.
15.
<?xml version="1.0" encoding="UTF-8"?>
<documents session_ui="4Aa246a6-D7e2-2465-a056-0234554369a3" version="1.34" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance">
<accept_notification action_id="607">
<subject_id>19527410000063</subject_id>
<counterparty_id>19799910034716</counterparty_id>
<operation_date>2017-05-10T15:06:00+05:00</operation_date>
<order_details>
<sgtin>7517003651019575FFBRHCS96LF</sgtin>
<sgtin>8767006421011245FFBRHCS96LF</sgtin>
<sgtin>6967741261369175FFBRHCS96LF</sgtin>
<sgtin>1397014766685175FFBRHCS96LF</sgtin>
<sgtin>5498621261015175FFBRHCS96LF</sgtin>
</order_details>
</accept_notification>
</documents>
сгенерированный модуль:
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.
254.
255.
256.
257.
258.
259.
260.
261.
262.
263.
264.
265.
266.
267.
268.
269.
270.
271.
272.
273.
274.
275.
276.
277.
278.
279.
280.
281.
282.
283.
284.
285.
286.
287.
288.
289.
290.
291.
{**************************************************************************************************}
{ }
{ XML Data Binding }
{ }
{ Generated on: 07.04.2020 22:09:25 }
{ Generated from: C:\Working Projects\RusSM\MDLPProject\TestXML\accept_notification607.xsd }
{ }
{**************************************************************************************************}
unit accept_notification607;
interface
uses xmldom, XMLDoc, XMLIntf;
type
{ Forward Decls }
IXMLAccept_notification = interface;
IXMLOrder_details = interface;
IXMLSign_sgtin_typeList = interface;
IXMLSscc_typeList = interface;
{ IXMLAccept_notification }
IXMLAccept_notification = interface(IXMLNode)
['{FB9FC79A-F295-43EA-8220-91CFBEC422A0}']
{ Property Accessors }
function Get_Action_id: Integer;
function Get_Subject_id: WideString;
function Get_Counterparty_id: WideString;
function Get_Operation_date: WideString;
function Get_Confirm_paused: Boolean;
function Get_Order_details: IXMLOrder_details;
procedure Set_Action_id(Value: Integer);
procedure Set_Subject_id(Value: WideString);
procedure Set_Counterparty_id(Value: WideString);
procedure Set_Operation_date(Value: WideString);
procedure Set_Confirm_paused(Value: Boolean);
{ Methods & Properties }
property Action_id: Integer read Get_Action_id write Set_Action_id;
property Subject_id: WideString read Get_Subject_id write Set_Subject_id;
property Counterparty_id: WideString read Get_Counterparty_id write Set_Counterparty_id;
property Operation_date: WideString read Get_Operation_date write Set_Operation_date;
property Confirm_paused: Boolean read Get_Confirm_paused write Set_Confirm_paused;
property Order_details: IXMLOrder_details read Get_Order_details;
end;
{ IXMLOrder_details }
IXMLOrder_details = interface(IXMLNode)
['{98159A3B-EBF0-4336-9941-6C7B1B719C33}']
{ Property Accessors }
function Get_Sgtin: IXMLSign_sgtin_typeList;
function Get_Sscc: IXMLSscc_typeList;
{ Methods & Properties }
property Sgtin: IXMLSign_sgtin_typeList read Get_Sgtin;
property Sscc: IXMLSscc_typeList read Get_Sscc;
end;
{ IXMLSign_sgtin_typeList }
IXMLSign_sgtin_typeList = interface(IXMLNodeCollection)
['{E7F4A50C-675C-487C-BD5A-7334D67442F3}']
{ Methods & Properties }
function Add(const Value: WideString): IXMLNode;
function Insert(const Index: Integer; const Value: WideString): IXMLNode;
function Get_Item(Index: Integer): WideString;
property Items[Index: Integer]: WideString read Get_Item; default;
end;
{ IXMLSscc_typeList }
IXMLSscc_typeList = interface(IXMLNodeCollection)
['{95D16471-9ABF-4A73-AE45-5B4D35AAEB1C}']
{ Methods & Properties }
function Add(const Value: WideString): IXMLNode;
function Insert(const Index: Integer; const Value: WideString): IXMLNode;
function Get_Item(Index: Integer): WideString;
property Items[Index: Integer]: WideString read Get_Item; default;
end;
{ Forward Decls }
TXMLAccept_notification = class;
TXMLOrder_details = class;
TXMLSign_sgtin_typeList = class;
TXMLSscc_typeList = class;
{ TXMLAccept_notification }
TXMLAccept_notification = class(TXMLNode, IXMLAccept_notification)
protected
{ IXMLAccept_notification }
function Get_Action_id: Integer;
function Get_Subject_id: WideString;
function Get_Counterparty_id: WideString;
function Get_Operation_date: WideString;
function Get_Confirm_paused: Boolean;
function Get_Order_details: IXMLOrder_details;
procedure Set_Action_id(Value: Integer);
procedure Set_Subject_id(Value: WideString);
procedure Set_Counterparty_id(Value: WideString);
procedure Set_Operation_date(Value: WideString);
procedure Set_Confirm_paused(Value: Boolean);
public
procedure AfterConstruction; override;
end;
{ TXMLOrder_details }
TXMLOrder_details = class(TXMLNode, IXMLOrder_details)
private
FSgtin: IXMLSign_sgtin_typeList;
FSscc: IXMLSscc_typeList;
protected
{ IXMLOrder_details }
function Get_Sgtin: IXMLSign_sgtin_typeList;
function Get_Sscc: IXMLSscc_typeList;
public
procedure AfterConstruction; override;
end;
{ TXMLSign_sgtin_typeList }
TXMLSign_sgtin_typeList = class(TXMLNodeCollection, IXMLSign_sgtin_typeList)
protected
{ IXMLSign_sgtin_typeList }
function Add(const Value: WideString): IXMLNode;
function Insert(const Index: Integer; const Value: WideString): IXMLNode;
function Get_Item(Index: Integer): WideString;
end;
{ TXMLSscc_typeList }
TXMLSscc_typeList = class(TXMLNodeCollection, IXMLSscc_typeList)
protected
{ IXMLSscc_typeList }
function Add(const Value: WideString): IXMLNode;
function Insert(const Index: Integer; const Value: WideString): IXMLNode;
function Get_Item(Index: Integer): WideString;
end;
{ Global Functions }
function Getaccept_notification(Doc: IXMLDocument): IXMLAccept_notification;
function Loadaccept_notification(const FileName: WideString): IXMLAccept_notification;
function Newaccept_notification: IXMLAccept_notification;
const
TargetNamespace = '';
implementation
{ Global Functions }
function Getaccept_notification(Doc: IXMLDocument): IXMLAccept_notification;
begin
Result := Doc.GetDocBinding('accept_notification', TXMLAccept_notification, TargetNamespace) as IXMLAccept_notification;
end;
function Loadaccept_notification(const FileName: WideString): IXMLAccept_notification;
begin
Result := LoadXMLDocument(FileName).GetDocBinding('accept_notification', TXMLAccept_notification, TargetNamespace) as IXMLAccept_notification;
end;
function Newaccept_notification: IXMLAccept_notification;
begin
Result := NewXMLDocument.GetDocBinding('accept_notification', TXMLAccept_notification, TargetNamespace) as IXMLAccept_notification;
end;
{ TXMLAccept_notification }
procedure TXMLAccept_notification.AfterConstruction;
begin
RegisterChildNode('order_details', TXMLOrder_details);
inherited;
end;
function TXMLAccept_notification.Get_Action_id: Integer;
begin
Result := AttributeNodes['action_id'].NodeValue;
end;
procedure TXMLAccept_notification.Set_Action_id(Value: Integer);
begin
SetAttribute('action_id', Value);
end;
function TXMLAccept_notification.Get_Subject_id: WideString;
begin
Result := ChildNodes['subject_id'].Text;
end;
procedure TXMLAccept_notification.Set_Subject_id(Value: WideString);
begin
ChildNodes['subject_id'].NodeValue := Value;
end;
function TXMLAccept_notification.Get_Counterparty_id: WideString;
begin
Result := ChildNodes['counterparty_id'].Text;
end;
procedure TXMLAccept_notification.Set_Counterparty_id(Value: WideString);
begin
ChildNodes['counterparty_id'].NodeValue := Value;
end;
function TXMLAccept_notification.Get_Operation_date: WideString;
begin
Result := ChildNodes['operation_date'].Text;
end;
procedure TXMLAccept_notification.Set_Operation_date(Value: WideString);
begin
ChildNodes['operation_date'].NodeValue := Value;
end;
function TXMLAccept_notification.Get_Confirm_paused: Boolean;
begin
Result := ChildNodes['confirm_paused'].NodeValue;
end;
procedure TXMLAccept_notification.Set_Confirm_paused(Value: Boolean);
begin
ChildNodes['confirm_paused'].NodeValue := Value;
end;
function TXMLAccept_notification.Get_Order_details: IXMLOrder_details;
begin
Result := ChildNodes['order_details'] as IXMLOrder_details;
end;
{ TXMLOrder_details }
procedure TXMLOrder_details.AfterConstruction;
begin
FSgtin := CreateCollection(TXMLSign_sgtin_typeList, IXMLNode, 'sgtin') as IXMLSign_sgtin_typeList;
FSscc := CreateCollection(TXMLSscc_typeList, IXMLNode, 'sscc') as IXMLSscc_typeList;
inherited;
end;
function TXMLOrder_details.Get_Sgtin: IXMLSign_sgtin_typeList;
begin
Result := FSgtin;
end;
function TXMLOrder_details.Get_Sscc: IXMLSscc_typeList;
begin
Result := FSscc;
end;
{ TXMLSign_sgtin_typeList }
function TXMLSign_sgtin_typeList.Add(const Value: WideString): IXMLNode;
begin
Result := AddItem(-1);
Result.NodeValue := Value;
end;
function TXMLSign_sgtin_typeList.Insert(const Index: Integer; const Value: WideString): IXMLNode;
begin
Result := AddItem(Index);
Result.NodeValue := Value;
end;
function TXMLSign_sgtin_typeList.Get_Item(Index: Integer): WideString;
begin
Result := List[Index].NodeValue;
end;
{ TXMLSscc_typeList }
function TXMLSscc_typeList.Add(const Value: WideString): IXMLNode;
begin
Result := AddItem(-1);
Result.NodeValue := Value;
end;
function TXMLSscc_typeList.Insert(const Index: Integer; const Value: WideString): IXMLNode;
begin
Result := AddItem(Index);
Result.NodeValue := Value;
end;
function TXMLSscc_typeList.Get_Item(Index: Integer): WideString;
begin
Result := List[Index].NodeValue;
end;
end.