added iQsh

Issue #4 closed
Former user created an issue

The latest XMLSERVICE supports <qsh> tag. I added iQsh class to itoolkit.js.

var assert = require('assert');
var NodeVer = process.version.slice(1,2);
assert.notEqual(NodeVer, '0', 'Unsupported version of Node.js!');
var xt = require('/QOpenSys/QIBM/ProdData/OPS/Node'+NodeVer+'/os400/xstoolkit/lib/itoolkit');
var hint = 'check the "success" property in return value'

var opt = {
  xslib : 'XMLSERVICE',
  db   : '*LOCAL',
  user : 'USER',
  pwd  : 'PWD'
  //host : 'ut28p63',
  //port : 80,
  //path : '/cgi-bin/xmlcgi.pgm'
};

var conn = new xt.iConn(opt.db,null,null,opt);
conn.debug(true);
conn.add(xt.iQsh('system wrksyssts'));
conn.run(function(str){
  var results = xt.xmlToJson(str);
  var success = true;
  results.every(function(result, i){
    if(result.hasOwnProperty('success'))
      success = result.success == true;
  });
  console.log(JSON.stringify(results));
});

Comments (6)

  1. Former user Account Deleted reporter

    Note: In example above i am overriding the default QXMLSERV(.lib) to XMLSERVICE(.lib). IBM DGO team (Apache) will need to produce a new PTF to update QXMLSERV copy of xmlservice. Also, i suppose IBM OPS node product will need to add PTF sometime.

    Anyway, you can download itoolkit from here. I replaced the Node4 version with this enhanced support in my test.

    bash-4.3$ cd /QOpenSys/QIBM/ProdData/OPS/Node4/os400/xstoolkit/lib
    bash-4.3$ ls 
    idataq.js         iobj.js           irest.js          itoolkit.js       iuserSpace.js     ixml.js
    inetwork.js       iprod.js          istoredp.js       itoolkit.js-orig  iwork.js          ixml.js-orig
    

    You can download and compile new xmlservice from yips into XMLSERVICE(.lib). Follow the installation instructions at yips xmlservice . Happy Open Source.

  2. mengxumx Account Deactivated

    XMLSERVICE PTF SI64215(7.1) and SI64216(7.2) are built to support the new iQsh tag. I have verified them with the new iQsh test case. But I can not build XMLSERVICE 1.9.9 on 7.3 systems.

  3. mengxumx Account Deactivated

    The three XMLSERVICE PTFs will be released soon.

    • IBM i 7.1 -- SI64215
    • IBM i 7.2 -- SI64216
    • IBM i 7.3 -- SI64324
  4. Log in to comment