Format buffer error calling .NET from Natural

Natural version: 4.1.4.6
EntireX version: 7.2.1
Natural IDL Gen version: 7.2.1.58
RPC Server version: 7.2.1.5

I am making a call from Natural to a .NET app using a data area (DA) that has group fields in it. There are two ways I can get it to work now:

  1. Modify the DA to have no group levels and generate a stub that uses the “old” template.
  2. Create a stub using the DA with group levels still in it, then use the parameter area created in that stub to overlay the parameter area in the stub generated for the DA with no group fields. Basically, a merge of the two stubs. This requires a good bit of work since the fields names do not match between the two templates used to create the stub programs.

When I try to use the stub program created for the DA that has group fields (the stubless template), it gets the following error:

0x00000ed0> . . . . . . returns: 10010009
0x00000ed0> . . . . . ) ERXUnmarshal
0x00000ed0> . . . . . 10050031 ERXUnmarshal() failed for dotNetServer/ERX_Exit_SERVER_CALL.
0x00000ed0> . . . . . ( ERXGetLastError (1. call)
0x00000ed0> . . . . . . returns: 00000000
0x00000ed0> . . . . . . MsgId : 10010009
0x00000ed0> . . . . . . MsgText :
0x00000ed0> . . . . . ) ERXGetLastError
0x00000ed0> . . . . . 10010009 Invalid format buffer. Location of wrong Parameter is 3.10050033 Could not resolve RPC call for START/XSDADVN9.
0x00000ed0> . . . . ) xDynamicCallback()
0x00000ed0> . . . . returns: 10010009
0x00000ed0> . . . ) ProcessCall
0x00000ed0> . . . SERVER checkpoint: at TransactionControl Control= 3,index=1
0x00000ed0> . . . ThreadSetStatus(Thread=1) ACTIVE_OCCUPIED → ACTIVE_OCCUPIED_RESET
0x00000ed0> . . . returns: 10010009

This is the generated IDL:

Library ‘SDSYLIB’ Is
Program ‘XSDADVN9’ Is
Define Data Parameter
1 PARAMS
2 G0001
3 G0002
4 #X0003 (A60)
4 #X0004 (A30)
4 #X0005 (A2)
4 #X0006 (A10)
4 #X0007 (A3)
3 G0008
4 #X0009 (N3)
4 G0010
5 #X0011 (A60/2)
5 #X0012 (A30/2)
5 #X0013 (A2/2)
5 #X0014 (A10/2)
5 #X0015 (A3/2)
5 #P0016 (N1.2/2)
5 #X0017 (N2/2)
5 #X0018 (N2/2)
End-Define

This is the stub program:


  • Stub XSDADVN9 generated in library: SDSYLIB
  • with Natural version: 4146
  • at: 04/03/2007 12:31:57
  • (c) Copyright Software AG Darmstadt 1993-2005. All rights reserved

DEFINE DATA
PARAMETER
1 #PARAMS
2 #G0001 /* inout
3 #G0002 /* inout
4 #X0003(A60) /* inout
4 #X0004(A30) /* inout
4 #X0005(A2) /* inout
4 #X0006(A10) /* inout
4 #X0007(A3) /* inout
3 #G0008 /* inout
4 #X0009(N3) /* inout
4 #G0010 /* inout
5 #X0011(A60/2) /* inout
5 #X0012(A30/2) /* inout
5 #X0013(A2/2) /* inout
5 #X0014(A10/2) /* inout
5 #X0015(A3/2) /* inout
5 #P0016(N1.2/2) /* inout
5 #X0017(N2/2) /* inout
5 #X0018(N2/2) /* inout
LOCAL USING NATRPCL
LOCAL
1 IN-BLOCK(A1/372)
1 REDEFINE IN-BLOCK
2 CBX(A192)
2 FB (A50/2)
2 FBX(A33)
2 GEN-STRING (A47)
END-DEFINE
GEN-STRING := ‘Natural version 4146, 2007-04-03 12:31:57, z/OS’
CB_LIB := *LIBRARY-ID
CB_PNAM := *PROGRAM
CB_USID := USER
CB_RESERV := ‘2’
ASSIGN CB_VERSION = CB_VERSION_2000
CB_NPARM := 22
CB_COMPRESS:=‘2’
RESET CB_NATERR_INFO CB_RESPONSECODE
ASSIGN FB(1) = ‘MG1,1MG2,1MA60,0MA30,0MA2,0MA10,0MA3,0MG2,0MG2,1MN’
ASSIGN FB(2) = ‘3,0MG3,1MA60,0,2MA30,0,2MA2,0,2MA10,0,2MA3,0,2MN1,’
ASSIGN FBX = ‘2,2MN2,0,2MN2,0,2MG3,0MG2,0MG1,0.’
SEND-LEN := 325
REC-LEN := -1
CB_STPLSET := ‘N’
MOVE CBBLOCK TO CBX
CALL ‘NATGWRPC’ FKT-STUBLESSRPCX ‘C’ SEND-LEN REC-LEN IN-BLOCK(
)
IF REC-LEN > -1 THEN ESCAPE ROUTINE
END-IF
CALLNAT ‘NATCLT4’ #PARAMS
END

The autorpc aspect of the call is triggering, as confirmed by the error coming from the RPC server. I’m thinking that it might be a version issue somewhere, but I haven’t been able to identify the cause of the problem yet.

Anyone have any ideas or suggestions?

Steve

Hello Steve,

theory says that it should work if you generate both a stub and an IDL file from the very same Natural subprogram.

There is definitely something wrong in the generated stub program so the RPC Server is right to complain. Th parameter area starts with 3 group elements (#PARAMS, #G0001, #G0002) but in “FB(1) = 'MG1,1MG2,1MA60” there are only 2 group elements, so there is a mismatch in the 3rd parameter.

You might try to regenerate the Natural stub in a clean environment. If this still fails I suggest to contact Support.