File tree Expand file tree Collapse file tree 1 file changed +32
-1
lines changed Expand file tree Collapse file tree 1 file changed +32
-1
lines changed Original file line number Diff line number Diff line change 1
1
# xmlToJsonCache
2
- Конвертация XML в JSON для языка программирования Cache Object Script
2
+ Connvert XML to JSON in Cache Object Script
3
+
4
+ For import Jar to Cache, should open STUDIO -> Tools -> Add-Ins -> Master Java Gateway
5
+
6
+ First put path to jar file named xmlToJson.jar
7
+
8
+ Second, put path to json-20180813.jar to Additional ClassPaths field
9
+
10
+ After import, the converter can be called like this:
11
+
12
+ ClassMethod xmlToJson(message As %String) As %Status
13
+ {
14
+ Set result = $$$OK
15
+
16
+ try {
17
+ Set gateway=##class(%Net.Remote.Gateway).%New()
18
+ Set status=gateway.%Connect("127.0.0.1",55555)
19
+
20
+ if 'status Quit
21
+ set obj = ##class(ParseXML.Parse).%New(gateway)
22
+ set res = obj.convertXMLtoJSON(message)
23
+
24
+ Set result = res
25
+ }Catch ex {
26
+ Do ex.Log()
27
+ Write ex.DisplayString(),!
28
+ ZWrite %objlasterror
29
+ }
30
+
31
+ Quit result
32
+ }
33
+
You can’t perform that action at this time.
0 commit comments