OK I have now got it working by calling an RPG program to do the QRCVDTAQ for me.

I am not sure I want to waste anyone's time with this - but if anyone happens to know why calling the QRTVDTAQ command directly does not work (for keyed queues) I would be interested to know.

-----Original Message-----
From: WEB400 [mailto:web400-bounces@xxxxxxxxxxxx] On Behalf Of Kevin Turner
Sent: 22 August 2015 20:11
To: Web Enabling the IBM i (AS/400 and iSeries)
Subject: [WEB400] Who knows all about XMLSERVICE?

A bit of background:

I am trying to access a keyed data queue from a node.js function using the IBM toolkit provided. Not entirely unexpectedly, the documentation with the toolkit is pretty sparse on examples https://www.ibm.com/developerworks/ibmi/library/i-native-js-app-ibmi-with-nodejs/

They provide a script called "idataq.js" that shows examples of sending and receiving data to a non-keyed data queue. It appears to use XMLSERVICE under the covers to do so, and it works as far as my testing goes. However, that is no good if you want to access a keyed data queue.

I figured I would just create a modified version of the supplied "receiveFromDataQueue" function to include the extra parameters needed for a keyed data queue, but it fails miserably. The XML error response from XMLSERVICE is virtually useless, but I have managed to glean the fact that it expects only 5 parameters, not the 8 I want to send it. Does anyone know how to make the error responses more meaningful?

The code appears to just create an XML interface to the QRCVDTAQ program, so why would it complain about only wanting 5 parameters unless it is some sort of hardcoded limit for the API built in to XMLSERVICE somewhere? Does anyone know if this is the case. The basic code for the version that works looks like this:

var xt = require('./itoolkit');
var pgm = new xt.iPgm("QRCVDTAQ", {"lib":"QSYS"}); pgm.addParam(name, "10A"); pgm.addParam(lib == ""?"*CURLIB":lib, "10A"); pgm.addParam(length, "5p0"); pgm.addParam("", length + 1 + "A"); pgm.addParam(0, "5p0");this.conn.add(pgm.toXML());
this.conn.run(toJson);

but calling QSNDDTAQ like this does not work var xt = require('./itoolkit'); var pgm = new xt.iPgm("QRCVDTAQ", {"lib":"QSYS"}); pgm.addParam(name, "10A"); pgm.addParam(lib == ""?"*CURLIB":lib, "10A"); pgm.addParam(length, "5p0"); pgm.addParam("", length + 1 + "A"); pgm.addParam(5, "5p0");this.conn.add(pgm.toXML());
pgm.addParam(keyOp, "2A");
pgm.addParam(keyLen, "3p0");
pgm.addParam(key, key.length + "A")
this.conn.run(toJson);

I thought I would try to write my own program to see if that would work (rather than using QRCVDTAQ directly) but I cannot find any examples of what my program signature should look like. I have looked at the documentation for XMLTOOLKIT for examples but (IMHO) the documentation is pretty dreadful.....not an uncommon complaint for IBM stuff.

Just a simple RPG example program would be useful.

Thanks

________________________________

NOTICE: The information in this electronic mail transmission is intended by CoralTree Systems Ltd for the use of the named individuals or entity to which it is directed and may contain information that is privileged or otherwise confidential. If you have received this electronic mail transmission in error, please delete it from your system without copying or forwarding it, and notify the sender of the error by reply email or by telephone, so that the sender's address records can be corrected.



--------------------------------------------------------------------------------


CoralTree Systems Limited
Company Registration Number 5021022.
Registered Office:
12-14 Carlton Place
Southampton
Hampshire
SO15 2EA
VAT Registration Number 834 1020 74.
--
This is the Web Enabling the IBM i (AS/400 and iSeries) (WEB400) mailing list To post a message email: WEB400@xxxxxxxxxxxx To subscribe, unsubscribe, or change list options,
visit: http://lists.midrange.com/mailman/listinfo/web400
or email: WEB400-request@xxxxxxxxxxxx
Before posting, please take a moment to review the archives at http://archive.midrange.com/web400.


___________________________________________
This email has been scanned by iomartcloud.
http://www.iomartcloud.com/


________________________________

NOTICE: The information in this electronic mail transmission is intended by CoralTree Systems Ltd for the use of the named individuals or entity to which it is directed and may contain information that is privileged or otherwise confidential. If you have received this electronic mail transmission in error, please delete it from your system without copying or forwarding it, and notify the sender of the error by reply email or by telephone, so that the sender's address records can be corrected.



--------------------------------------------------------------------------------


CoralTree Systems Limited
Company Registration Number 5021022.
Registered Office:
12-14 Carlton Place
Southampton
Hampshire
SO15 2EA
VAT Registration Number 834 1020 74.

As an Amazon Associate we earn from qualifying purchases.

This thread ...

Replies:

Follow On AppleNews
Return to Archive home page | Return to MIDRANGE.COM home page

This mailing list archive is Copyright 1997-2024 by midrange.com and David Gibbs as a compilation work. Use of the archive is restricted to research of a business or technical nature. Any other uses are prohibited. Full details are available on our policy page. If you have questions about this, please contact [javascript protected email address].

Operating expenses for this site are earned using the Amazon Associate program and Google Adsense.