Toolkit request failed. 22504

Post Reply
Posts: 5
Joined: Wed May 11, 2016 9:32 am

Toolkit request failed. 22504

Post by fran3576 » Mon Jul 18, 2016 11:31 am

Hi, The toolkit call a cobol program that do insert and update. If i have special characther like è+ùàòè it failed.

I think is some cssid or other think wrong.

The message is: Toolkit request failed. Review the database code and message. Database code (if any): '22504'. Message: Dati misti o UTF-8 non formati nella maniera appropriata. (mixed data or utf-8 data not properly formed)

The toolkit use ISO-8859-1 and my page is utf-8. So i do an utf8_decode.

i think is a problem with cssid or other. I see that there is a setToolkitServiceParams(array('ccsidBefore'=>'37/1208', 'ccsidAfter'=>'1208/37', 'useHex'=>false)) but how can i set this? i try this but nothing.

i have this configuration on language/ccsid

IBM i server CCSID and Language settings
System CCSID . . . . . .: 65535
Job CCSID . . . . . . . . 65535
Language ID . . . . . . : ITA

FastCGI Language and CCSID settings (/www/zendsvr6/conf/fastcgi.conf)
CCSID (ASCII) . . . . . : 1208 Number, 819(Latin), 1208(UTF-8)...
Language ID . . . . . . : C en_US, de_DE, fr_FR...

Link for ASCII CCSID and Language table codes:

Apache web server settings (/www/zendsvr/conf/http.conf)
CGIJobCCSID . . . . . . : 280 Number, 37(ENU), 297(FRA), 273(DEU).
DefaultFsCCSID. . . . . : 280 Number, 37(ENU), 297(FRA), 273(DEU).

Posts: 16
Joined: Fri Jan 20, 2012 6:30 pm

Re: Toolkit request failed. 22504

Post by graebert » Mon Jul 18, 2016 5:08 pm

I used to have problems with special german characters (and in some odd cases I still have).
Here are some tips which worked for me. I Think, it will help you, too.

1) Your HTTP-Server settings should be OK: CGIJobSSCID = 280, DefaultFsCCSID = 280. If possible, change system Value QCCSID to 280 (But your current value 65535 is most likely not the cause of your problem). Fastcgi.conf settings look OK, too.

2) Best is to use UTF-8/1208 in all other places: PHP, XML toolkit, your html and php files. My experience is: everything works just fine then, i.e. no need for utf8_decode/utf8_encode. Also no need for ccsidBefore and ccsidAfter. (In case you need ccsidBefore and ccsidAfter, you als have to specify useHex = true)

To use UTF-8 in PHP
- /usr/local/zendsvr6/etc/php.ini: default_charset="UTF-8"

To use UTF-8 in XML toolkit:
- /usr/local/zendsvr6/share/ToolkitAPI/toolkit.ini): encoding = "UTF-8" (in [system] section)
or after establishing your toolkit connection: $ToolkitServiceObj->setOptions(array('encoding'=>UTF-8'));

ccsidBefore/ccsidAfter/useHex can be speicified in toolki.ini, or using $ToolkitServiceObj->setOptions(). But as I said, since I made the transition from ISO-8859-1 to UTF-8 I don't need it anymore.

Best Regards,

Posts: 5
Joined: Wed May 11, 2016 9:32 am

Re: Toolkit request failed. 22504

Post by fran3576 » Tue Jul 19, 2016 8:28 am

Thank you Christian for the reply!

I find this solution :


I set "ibm_db2.i5_override_ccsid=0" and now the update from the toolkit is fine. Without this directive all db2 connection is set to UTF-8 ovverriding cssid of application!

I don't use ccsid 1208 but 819 latin and i use utf8_encode/decode because the application use this.

I also see However that with ccsid 1208 i don't need utf8_encode/decode ( my page all with charset='utf-8'). Is all automatic? i don't understand fine how it works.

But with the toolkit i have some problems with update and insert with special character. I think somewhere zend or db2 or toolkit do some translation and lost the right characthers (also setting utf-8 in the toolkit ini...)
With ibm_db2.i5_override_ccsid=0 i have no problem.

thanks again for the reply.

Post Reply