Last active
August 29, 2015 14:20
-
-
Save phpdave/836efa7dabb4630eda8a to your computer and use it in GitHub Desktop.
Thinking about JSONService for IBM i
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
I think the main advantages are readability and simplicity (no root xml element, or closing tags). | |
XML vs JSON article: http://www.mashery.com/blog/api-data-exchange-xml-vs-json |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
{ | |
"cmd": "CHGLIBL LIBL(XMLSERVICE) CURLIB(XMLSERVICE)", | |
"pgm": { | |
"name": "ZZCALL", | |
"parms": [ | |
[ | |
"1A", | |
"a" | |
], | |
[ | |
"1A", | |
"b" | |
], | |
[ | |
"7p4", | |
"11.1111" | |
], | |
[ | |
"12p2", | |
"222.22" | |
] | |
], | |
"ds": [ | |
[ | |
"1A", | |
"x" | |
], | |
[ | |
"1A", | |
"y" | |
], | |
[ | |
"7p4", | |
"66.6666" | |
], | |
[ | |
"12p2", | |
"77777.77" | |
] | |
] | |
}, | |
"sql": { | |
"query": "select * from QIWS.QCUSTCDT where LSTNAM='Jones'", | |
"fetch": { | |
"block": "all" | |
} | |
} | |
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
{"cmd":"CHGLIBL LIBL(XMLSERVICE) CURLIB(XMLSERVICE)","pgm":{"name":"ZZCALL","parms":[["1A","a"],["1A","b"],["7p4","11.1111"],["12p2","222.22"]],"ds":[["1A","x"],["1A","y"],["7p4","66.6666"],["12p2","77777.77"]]},"sql":{"query":"select * from QIWS.QCUSTCDT where LSTNAM='Jones'","fetch":{"block":"all"}}} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
{ | |
"cmd": "CHGLIBL LIBL(XMLSERVICE) CURLIB(XMLSERVICE)", | |
"pgm": { | |
"name": "ZZCALL", | |
"parms": [ | |
{ | |
"type": "1A", | |
"value": "a" | |
}, | |
{ | |
"type": "1A", | |
"value": "b" | |
}, | |
{ | |
"type": "7p4", | |
"value": "11.1111" | |
}, | |
{ | |
"type": "12p2", | |
"value": "222.22" | |
} | |
], | |
"ds": [ | |
{ | |
"type": "1A", | |
"value": "x" | |
}, | |
{ | |
"type": "1A", | |
"value": "y" | |
}, | |
{ | |
"type": "7p4", | |
"value": "66.6666" | |
}, | |
{ | |
"type": "12p2", | |
"value": "77777.77" | |
} | |
] | |
}, | |
"sql": { | |
"query": "select * from QIWS.QCUSTCDT where LSTNAM='Jones'", | |
"fetch": { | |
"block": "all" | |
} | |
} | |
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
<?xml version='1.0'?><xmlservice><cmd>CHGLIBL LIBL(XMLSERVICE) CURLIB(XMLSERVICE)</cmd><pgm name='ZZCALL'><parm><data type='1A'>a</data></parm><parm><data type='1A'>b</data></parm><parm><data type='7p4'>11.1111</data></parm><parm><data type='12p2'>222.22</data></parm><parm><ds><data type='1A'>x</data><data type='1A'>y</data><data type='7p4'>66.6666</data><data type='12p2'>77777.77</data></ds></parm></pgm><sql><query>select * from QIWS.QCUSTCDT where LSTNAM='Jones'</query><fetch block='all'/></sql></xmlservice> |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
<?xml version='1.0'?> | |
<xmlservice> | |
<cmd>CHGLIBL LIBL(XMLSERVICE) CURLIB(XMLSERVICE)</cmd> | |
<pgm name='ZZCALL'> | |
<parm><data type='1A'>a</data></parm> | |
<parm><data type='1A'>b</data></parm> | |
<parm><data type='7p4'>11.1111</data></parm> | |
<parm><data type='12p2'>222.22</data></parm> | |
<parm> | |
<ds> | |
<data type='1A'>x</data> | |
<data type='1A'>y</data> | |
<data type='7p4'>66.6666</data> | |
<data type='12p2'>77777.77</data> | |
</ds> | |
</parm> | |
</pgm> | |
<sql> | |
<query>select * from QIWS.QCUSTCDT where LSTNAM='Jones'</query> | |
<fetch block='all'/> | |
</sql> | |
</xmlservice> |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment