Using nested X-arrays in EntireX RPC

I Need help getting an RPC to work with X-arrays in an EntireX RPC. It is getting errors from the following IDL/C# code, which was generated from the Entire-X workbench, pulling from a mainframe Natural subprogram. It works with the parent-x-array and the first nested x-array, but when referencing the second nested x-array, it dies. The RPC on Windows/C# is not able to marshal the data into the stub. The error is on the Windows side. We reviewed the data, and it is structured correctly, and should marshal, but does not.

/==========================================================================
** ESKGTEST - IDL
**========================================================================
/

/* Generated by Software AG, IDL Extractor for Natural (9.6.0.0.161) on 2017-03-24 at 13:15:34
/* Natural 8.2.5.6 (System File), SYSIDL 6.3.13.0
/* Library Name From Saved on Cataloged on
/* ----------------------------------------------------------------
/* DRS ESKGTEST Source 2017-03-24 12:21:54 2017-03-24 12:21:54
library ‘DRS’ is
program ‘ESKGTEST’ is
define data parameter
1 #ESWN0136-INPUT
2 #ESWN0136-EMPLYR-DATA
3 #ESWN0136-EMPLYR-ID (N8)
2 #ESWN0136-RPT-GRP-DATA (/1:V) /* Full usage: (/1:) : Originates from Natural X-array
3 #ESWN0136-RPT-GRP-ID (A6)
3 #ESWN0136-RPT-GRP-PAST-RPTG-GRP (/1:V) /
Full usage: (/1:) : Originates from Natural X-array
4 #ESWN0136-RPT-GRP-PAST-RPTG (A6)
3 #ESWN0136-RPT-GRP-TEST1-GRP (/1:V) /
Full usage: (/1:) : Originates from Natural X-array
4 #ESWN0136-RPT-GRP-TEST1-DATA (N6)
3 #ESWN0136-RPT-GRP-TEST2-GRP (/1:V) /
Full usage: (/1:*) : Originates from Natural X-array
4 #ESWN0136-RPT-GRP-TEST2-DATA (N6)
1 #ESWN0136-OUTPUT
2 #ESWN0136-ERROR
3 #ESWN0136-RETURN-CODE (N3)
3 #ESWN0136-ERR-SEVERITY (N1)
3 #ESWN0136-MSG (A80)

end-define

/==========================================================================
** ESKGTEST - Generated C#
**========================================================================
/

#region * * * P L E A S E D O N O T M O D I F Y * * *
/***************************************************************************
** Module name : Drs.cs
** Description : Client Stub File for .NET (9.6.0.0)
**
** * * * P L E A S E D O N O T M O D I F Y * * *
**
** Author : Generated by Software AG EntireX IDL Compiler
** Template : csharp_client.tpl for C#
** Platform : .NET-able Platforms
** Usage :
*/
#endregion
#region parameters
/

** sanitize C#
** Broker : disv1.dis.wa.gov:3097
** Service : RPC/DRSDB/CALLNAT
** ATOSTRING : String
** A1TOCHAR : false
** B1TOBYTE : false
** TRIM : true
** SANITIZE : true
***************************************************************************/
#endregion
#region required namespaces
using System;
using System.Text;
using System.Runtime.InteropServices;
using SoftwareAG.EntireX.NETWrapper.Runtime;
#endregion

#region AssemblyInfo
#if USE_ASSEMBLY_INFO
using System.Reflection ;
[assembly: AssemblyTitle(“EntireX .NET Wrapper Client”)]
[assembly: AssemblyDescription(“EntireX .NET Wrapper Client”)]
[assembly: AssemblyConfiguration(“”)]
[assembly: AssemblyCompany(“Software AG”)]
[assembly: AssemblyProduct(“EntireX Communicator”)]
[assembly: AssemblyCopyright(“”)]
[assembly: AssemblyTrademark(“”)]
[assembly: AssemblyCulture(“”)]
[assembly: AssemblyVersion(“1.0.*”)]
[assembly: AssemblyDelaySign(false)]
[assembly: AssemblyKeyFile(“”)]
[assembly: AssemblyKeyName(“”)]
#endif
#endregion

namespace SoftwareAG.EntireX.NETWrapper.Generated.DRS.Groups
{
#region Groups for LIBRARY ‘DRS’, PROGRAM ‘ESKGTEST’

public class Eskgtest
{
public class Eswn0136Input
{
[SendAs(IdlType.Group, Id=0)]public Eswn0136EmplyrData eswn0136EmplyrData = new Eswn0136EmplyrData();
public class Eswn0136EmplyrData
{
[SendAs(IdlType.N, preDecimal=8, postDecimal=0, Id=0)]public decimal eswn0136EmplyrId;
}
[SendAs(IdlType.Group, Id=1, Dim=0f, Unbounded = true, Dimensions = 1)]public Eswn0136RptGrpData eswn0136RptGrpData = (Eswn0136RptGrpData)Construction.GroupArray(typeof(Eswn0136RptGrpData), 1 , 0 , 0 );
public class Eswn0136RptGrpData
{
[SendAs(IdlType.A, Length=6f, Id=0, Trim=true)]public string eswn0136RptGrpId ;
[SendAs(IdlType.Group, Id=1, Dim=0f, Unbounded = true, Dimensions = 1)]public Eswn0136RptGrpPastRptgGrp eswn0136RptGrpPastRptgGrp = (Eswn0136RptGrpPastRptgGrp)Construction.GroupArray(typeof(Eswn0136RptGrpPastRptgGrp), 1 , 0 , 0 );
public class Eswn0136RptGrpPastRptgGrp
{
[SendAs(IdlType.A, Length=6f, Id=0, Trim=true)]public string eswn0136RptGrpPastRptg ;
}
[SendAs(IdlType.Group, Id=2, Dim=0f, Unbounded = true, Dimensions = 1)]public Eswn0136RptGrpTest1Grp eswn0136RptGrpTest1Grp = (Eswn0136RptGrpTest1Grp)Construction.GroupArray(typeof(Eswn0136RptGrpTest1Grp), 1 , 0 , 0 );
public class Eswn0136RptGrpTest1Grp
{
[SendAs(IdlType.N, preDecimal=6, postDecimal=0, Id=0)]public decimal eswn0136RptGrpTest1Data;
}
[SendAs(IdlType.Group, Id=3, Dim=0f, Unbounded = true, Dimensions = 1)]public Eswn0136RptGrpTest2Grp eswn0136RptGrpTest2Grp = (Eswn0136RptGrpTest2Grp)Construction.GroupArray(typeof(Eswn0136RptGrpTest2Grp), 1 , 0 , 0 );
public class Eswn0136RptGrpTest2Grp
{
[SendAs(IdlType.N, preDecimal=6, postDecimal=0, Id=0)]public decimal eswn0136RptGrpTest2Data;
}
}
}
public class Eswn0136Output
{
[SendAs(IdlType.Group, Id=0)]public Eswn0136Error eswn0136Error = new Eswn0136Error();
public class Eswn0136Error
{
[SendAs(IdlType.N, preDecimal=3, postDecimal=0, Id=0)]public decimal eswn0136ReturnCode;
[SendAs(IdlType.N, preDecimal=1, postDecimal=0, Id=1)]public decimal eswn0136ErrSeverity;
[SendAs(IdlType.A, Length=80f, Id=2, Trim=true)]public string eswn0136Msg ;
}
}
}

#endregion
}
namespace SoftwareAG.EntireX.NETWrapper.Generated.DRS
{
[EntireXVersion(“9.6.0.0”)]
[Library(“DRS”)]
[Broker(“disv1.dis.wa.gov:3097”)]
[Service(“RPC/DRSDB/CALLNAT”)]
public class Drs : ServiceHolder
{
#region Constructor(s) etc for LIBRARY ‘DRS’

public Drs() : base() {}
public Drs(Broker broker) : base ( broker ) {}
public Drs(Service service) : base ( service ) {}

#endregion
#region Method/Function for LIBRARY ‘DRS’ PROGRAM ‘ESKGTEST’

[Program("ESKGTEST")]
public void Eskgtest(
  [SendAs(IdlType.Group)][In, Out] ref SoftwareAG.EntireX.NETWrapper.Generated.DRS.Groups.Eskgtest.Eswn0136Input eswn0136Input,
  [SendAs(IdlType.Group)][In, Out] ref SoftwareAG.EntireX.NETWrapper.Generated.DRS.Groups.Eskgtest.Eswn0136Output eswn0136Output
){
  service.Send(
    this.GetType().GetMethod("Eskgtest"),
    eswn0136Input,
    eswn0136Output
  );
}

#endregion
}
}

Hi Darrell,

we can’t see anything wrong here. For further investigation please open a support ticket and provide traces from both the .NET client and the Natural RPC server.

I get a flashback regarding a similar issue
I can see the generation says it comes from version 9.6.0.
There is a fix for an issue regarding the runtime
“EXX-7120: MiniRuntime .NetWrapper AccessViolationException: Attempted to read or write protected memory.”
which is in fixes for exx96.
So if this is the error you get ? Then before raising a issue you might want to check if you have this fixes applied ?
Finn

okay. I will go looking for fixes. It is good to know there is nothing wrong with the IDL and generated stub. The error was about being unable to marshal the data. I suppose that can come from a deeper protected-memory error. Thank you both (Rolf and Finn-the-Dane).

Good point Finn, thanks!

I usually ignore the fact that customers might not run the latest fix level …