I don't think the AG is relevant - all you have to do is mane sure that the API is only called once to create the table and then the table is used multiple times performing the conversions. The AG was only relevant when you tried to get the error using a procedure in CGIDEV2.

On 12 Nov 2013, at 10:19, "Jan Grove Vejlstrup" <jgv@xxxxxxxx> wrote:

The program, that gets called, when the service is called, is the
program, where QtqIconvOpen is called. Am I right, that this program
should run in a named activation group?

Jan

Am 11.11.2013 13:50, schrieb Kevin Turner:
Yeah, any mechanism like that. Just call an initialisation procedure each time, but that procedure only does something once, conditioned by a static indicator (or a global one). We have such a procedure that sets up lots of tables for converting from/to a wide range of CCSID's - and they all only get created once per invocation.
Like you say, you don't really need to call icon_close at all.

-----Original Message-----
From: web400-bounces@xxxxxxxxxxxx [mailto:web400-bounces@xxxxxxxxxxxx] On Behalf Of Jan Grove Vejlstrup
Sent: 11 November 2013 12:39
To: web400@xxxxxxxxxxxx
Subject: Re: [WEB400] IWS - Problem with QtqIconvOpen

Hello Kevin

Thank you very much for your mail. How can I achieve only calling QtqIconvOpen once? With a variable isIconvInitialized? First time setting it to *on and only calling QtqIconvOpen, when it's *off?
iconv_close need not to be called. Storage of the iconv-table is freed, when the service is stopped?

Best regards

Jan

Am 11.11.2013 11:49, schrieb Kevin Turner:
Jan


Why are you calling QtqIconvConvOpen every time you want to do a conversion? That is not necessary, and maybe why you are getting a problem. Whether you want to perform 1 conversion or 250000 conversions, you only need to call that API once - before you start your calls to iconv().


Rgds
Kevin


-----Original Message-----
From: web400-bounces@xxxxxxxxxxxx [mailto:web400-bounces@xxxxxxxxxxxx]
On Behalf Of Jan Grove Vejlstrup
Sent: 11 November 2013 10:11
To: web400 Midrange
Subject: [WEB400] IWS - Problem with QtqIconvOpen

Hello,

I'm using the Integrated Webservice Support (IWS) to provide a Webservice. The consumer of the service must provide a customer-number, an article-number and a quantity. The service calculates the price and delivers it in a XML, This XML is encoded in UTF-8 and base64 encoded.
The service is serving a webshop.

The XML is created by a separate program using a template and functions from CGIDEV2 from Giovanni Perotti. The program gives a pointer and length of a buffer back to the calling program. In the calling program, I put the content of the buffer to a string. Then I the use ICONV to convert this string from EBCDIC MNCS (CCSID 500) to UTF-8 (CCSID 1208).
The converted string is base64 encoded, using functions from the IBM-serviceprogram qsysdir/qaxis10ht.

This have been working fine for almost a year now. Typically the service was consumed 40'000 -- 70'000 times a day. During the nightly save-operation the service is down, it starts again after the save.

These last days, new functions have been added to the webshop. The result is, that the webservice is called more than 250'000 times a day.
After some 12 hours and more than 175'000 calls, I have a problem with the api QtqIconvOpen, that generates the table for the ICONV conversion.
The code snippet is:

from.CCSID = 500; // ebcdic MNCS
to.CCSID = 1208; // UTF-8

table = QtqIconvOpen(to: from);
if (table.return_value = -1);
err = errno;
msg = 'QtgIconvOpen: ' + %char(err) + '*';
dsply msg;
*inlr = *on;
return;
endif;

input_data2 = stringWithOutHex15;
%len(output_data2) = %size(output_data2) - 2;

p_input = %addr(input_data2) + 2;
inleft = %len(input_data2);

p_output = %addr(output_data2) + 2;
outleft = %len(output_data2);

if iconv( table
: p_input
: inleft
: p_output
: outleft ) = -1;
err = errno;
iconv_close(table);
msg = 'iconv: ' + %char(err) + '*';
dsply msg;
*inlr = *on;
return;
endif;

%len(output_data2) = %len(output_data2) - outleft; len =
%len(output_data2);

if iconv_close(table) = -1;
err = errno;
msg = 'iconv_close: ' + %char(err) + '*';
dsply msg;
*inlr = *on;
return;
endif;




The QtgIconvOpen fails and puts this on the log:

DSPLY QtgIconvOpen: 0*

I was hoping, that the errno would tell me the reason of the failure.
The errno is defined in the prototypeb of the CGIDEV2.

After the conversion I release the storage used by the conversion-table (iconv_close).

I can't find the error. Can someone please help me?

As a temporary workaround, I stop the service (endtcpvr) after approx 10 hours, wait a few seconds and start it again (strtcpvr).

Thank you very much in advance.

Best regards

Jan








--
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.


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.


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.


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.