[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

RE: NULL CHARACTERS AT THE END OF STRING FIELD



To make sure I understand. You are passing 100 chars to a program that builds XML and the parm in that XML has x'00' filling out the 100 chars. Did you check the parm on the way in to the program? It probably has the x'00' in it too.

If so, how are you calling the program?

x'00' can occur for a couple of reasons. One is the 32 char rule for passing parameters to CLP. If you do this in a CLP:

pgm parm(&my100char)
dcl &my100char *char 100

and then call the program like this: call mypgm '1'

You can end up with this:

F1404040 40404040 40404040 40404040
40404040 40404040 40404040 40404040
40000000 00000000 00000000 00000000
 etc

Not sure if that is what you are seeing but a common problem that causes x'00'.

Fixes for this are elsewhere and include using commands over the top of the CLP or initializing the variable you pass to the RPG yourself.

I think this will point you in the right direction.
  

-----Original Message-----
From: ftpapi-bounces@xxxxxxxxxxxxxxxxxxxxxx [mailto:ftpapi-bounces@xxxxxxxxxxxxxxxxxxxxxx] On Behalf Of gilles.renne@xxxxxxxxxxxxxxxxx
Sent: Thursday, May 02, 2013 9:40 AM
To: ftpapi@xxxxxxxxxxxxxxxxxxxxxx
Subject: NULL CHARACTERS AT THE END OF STRING FIELD


Hi


i consume a web service in which i have a STRING 100 characters long
if i send less that 98 charracters Marshaller_toString function add NULL at
the end then http return a bas request error
how can i porevent this NULL ?

regards

Gilles Renne
here is what i retrieve from httpapi_debug
and i send only  "F0101Z1Payment Terms Code Invalid3352TRAR" on last
parameter.



parameter in entry
This message contains confidential information. To know more, please click on the following link: http://disclaimer.bureauveritas.com   
-----------------------------------------------------------------------
This is the FTPAPI mailing list.  To unsubscribe, please go to:
http://www.scottklement.com/mailman/listinfo/ftpapi
-----------------------------------------------------------------------