I have a NATURAL client like the following
DEFINE DATA LOCAL
1 #NAME (A2)
CALLNAT ‘INSERT’ #NAME
I use ENX and we generated our stub by C
When I run the NATURAL Program , I get 6979
This is my insert method in C
void ERX_CALL_DECLARATION INSERT (
id = ‘s’;
and the server side gives error :
11:07:34 WORKER(0ffc): 10050033 Could not resolve RPC call for SYSTEM/INSERT.
11:07:34 WORKER(0ffc): 10050044 ERXDynDispatch() failed.
11:07:34 WORKER(0ffc): 10010009 Invalid format buffer. Location of wrong Paramet
er is 1.
What is the possible reason ?
and when I change #name to A1 I get no errors !!!
The C wrapper offers for A type fields 2 different styles
- C style strings with null-termination
- Mainframe style strings without null-termination
You can control this at generation time of the stubs.
The C prototype you posted is for an A2 field and uses C style in the C interface. You can see this in the [2+1] length of the function prototype.
For a mainframe style you would got a length of  in the server frame.
If you use C style or Mainframe style on the C side should not effect the partner - field length is still 2 bytes (because of A2).
For an A1 field there is no difference in the mapping. It is mapped to a char type always in the C interface, not a string, neither C-style nor Mainframe style. But also this must not affect the partner - field length is still 1 byte (because of A1).
Your observation look like a bug. Can you provide a RPC Server trace with trace level support (Specify TraceLevel=SUPPORT in the config file) for the situation where it is not working and open a Support Request?
Regards Bernhard Fricke
[This message was edited by Bernhard Fricke on 05 Nov 2004 at 13:50.]
[This message was edited by Bernhard Fricke on 05 Nov 2004 at 13:51.]