Closed owen-rpx closed 3 years ago
Can you please show me more details on what the result/error was? Was the URI chars were escaped in the browser? Was the job calling XMLService in the job ccsid as you expected? What ccids was your cmd/pgm expecting for chars encoded with?
@jimoibm @kadler I need to run cmd and store the china chars into DB2. Below is cmd results:
`<?xml version="1.0"?>
Are you saying it is working now?
Not working, I use Postman to debug it and Post method url is http://xxx.xxxx.com:portNum/cgi-bin/xmlcgi.pgm The CMD1 is placeholder, yes. I try to use hex='on' as below: `<?xml version="1.0"?>
hex='on' means you need to give hexadecimal....
before/after='fromCCSID/toCCSID' you need consider well on your job ccsid/parm ccsid pgm taking in
if using command call, you need to HEX'd all the command string.. You may consider using pgm call for better control of ccsid conversion on the only needed parms
If hit error complaining Argument list too long., it is caused by a bug below if receiver needs to be bigger than input for iconv(). Try using hex without conversion and workaround in your code..
size = anyBIG(index).bigsize; <-- should be bigger for receiver
rc = iconv(conv.conv
:%addr(fromPtr):%addr(fromBytes)
:%addr(toPtr):%addr(toBytes)); <-- toBytes should greater than fromBytes
Possible one spot change:
P cacAddBig B export
D cacAddBig PI 10i 0
D bsize 10i 0 value
D btype 1A value
...
/free
bsize = bsize * 4; <--- make a bigger receiver size...
....
Command call example:
CHGLIB LIB(JIMOCN) TEXT('中')
935 -> 1208
hex -> IN: C3C8C7D3C9C240D3C9C24DD1C9D4D6C3D55D40E3C5E7E34D7D0E5BCF0F7D5D404040404040404040
hex -> OUT: 4348474C4942204C4942284A494D4F434E2920544558542827E4B8AD2729202020202020202020
&ipc=*NA&ctl="*here"&xmlin="<?xml version='1.0'?><cmd hex='on' before='1208/935' after='935/1208'>4348474C4942204C4942284A494D4F434E2920544558542827E4B8AD2729202020202020202020</cmd>"&xmlout=500000
Result:
<?xml version='1.0'?><cmd hex='on' before='1208/935' after='935/1208'><success>+++ success CHGLIB LIB(JIMOCN) TEXT('$õ')</success>
</cmd>
My web page will input Chinese chars like '測試'
My nodejs will send xml str to XmlService with Post method and the form body like below: `<?xml version="1.0"?>