Synergex/HarmonyCore

Harmony.Core.Utility.BridgeException: SYSTEM.ARGUMENTOUTOFRANGEEXCEPTION: Value out of range

tscaff opened this issue · 5 comments

tscaff commented

When generating a new method and dispatcher for a new API call that passes a memory handle, we getting the following error message during the service method call.

Harmony.Core.Utility.BridgeException: SYSTEM.ARGUMENTOUTOFRANGEEXCEPTION: Value out of range

To Reproduce
Steps to reproduce the behavior:

  1. Define a method call in your method catalog files as such.
    {xfMethod(intWeblib, elbmacro, name="GetDocument")}
    .subroutine GetDocument
    {xfParameter(name="file")}
    in required file ,string

    {xfParameter(type=SynType.binaryhandle)}
    inout required FileToCopy ,i4

    endparams

    record
    return_code ,d4
    return_message ,a200

.proc
xcall GetDocumentFile(file,1,0,FileToCopy,return_code, return_message)
xreturn
.end

  1. Perform a HarmonyCore regen to generate all the associated method dispatchers, service calls and models.
  2. Add all the new models to your Harmony Core projects.
  3. Build the project.
  4. Define your JSON request as such in swagger or in Postman:
    {
    "file": "MyTestFile.txt",
    "FileToCopy": []
    }
  5. Send request. Exception is reported in the return with a 500 internal Server Error.

Expected behavior
I would expect the call to complete and return a binary array.

Screenshots
N/A

Desktop (please complete the following information):

  • OS: Windows 10
  • Browser chrome
  • Version 115.0.5790.171

Smartphone (please complete the following information):
N/A

Additional context
Add any other context about the problem here.

tscaff commented

Good morning. I haven't see any responses or movement on this items. Is there anyone available to look at this and see what's going on with the code generation? I am not quite sure where the issue is.

sorry tom, looking at it right now. This is missing functionality right now so the fix is non trivial.

actually I've changed my mind, It looks like we did implement this and have an automated test for it here

Whats the actual call stack for this exception? if you got "Harmony.Core.Utility.BridgeException: SYSTEM.ARGUMENTOUTOFRANGEEXCEPTION: Value out of range" from the .NET exception you should be able to examine the RemoteStackTrace property to see what the call frames were.

tscaff commented

Jeff there was some information in those logs I need you to see directly. So I sent them via another channel.

tscaff commented

I want to give a big shout out to @hippiehunter for helping me get this working. With the latest template modifications and a few tweaks in our own code, we have our binary handle's working perfectly. Thanks.