Synergex / HarmonyCore

Harmony Core is a framework that consists of libraries, CodeGen templates, and conventions that enable you to expose Synergy logic and data as a RESTful web service using OData and ASP.NET Core
BSD 2-Clause "Simplified" License
23 stars 14 forks source link

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

Closed tscaff closed 6 months ago

tscaff commented 1 year ago

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):

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

Additional context Add any other context about the problem here.

tscaff commented 1 year ago

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.

hippiehunter commented 1 year ago

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

hippiehunter commented 1 year ago

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 1 year ago

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

tscaff commented 1 year ago

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.