Skip to content

Commit 4ac3e34

Browse files
authored
Update README.md
1 parent 02b7c5e commit 4ac3e34

File tree

1 file changed

+32
-1
lines changed

1 file changed

+32
-1
lines changed

README.md

Lines changed: 32 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,2 +1,33 @@
11
# 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+

0 commit comments

Comments
 (0)