[Progress Communities] [Progress OpenEdge ABL] Forum Post: REST methods returning LONGCHAR results in error

Status
Not open for further replies.
N

Neil Treeby

Guest
Using 11.7.5, PDSOE, local "classic" restbroker1 AppServer, built-in Tomcat, built-in restmgr1 OE Web Server on the default port. The only thing not "local" is the db restbroker1 connects to, though I'm sure that's not relevant here. Maybe I'm doing something wrong, or there's some documentation explaining this behavior. I've not come across anything about this on the KB or elsewhere in the community. If I map a method like this to a URI: /* ping.cls */ CLASS ping: METHOD PUBLIC CHARACTER doPing(): DEFINE VARIABLE vcRetVal AS CHARACTER NO-UNDO. ASSIGN vcRetVal = "okay". RETURN vcRetVal. END METHOD. END CLASS. ... I get the expected response: {"response":{"_retVal":"okay"}} However if all I do is change the return type of the 'doPing()' method from CHARACTER to LONGCHAR (with a corresponding change of the data type of the vcRetVal variable), I get an error: com.progress.open4gl.Open4GLException: Invalid data type specified for return type. (12473) I can't even find a log file where this error is occurring - it's not in either of the restbroker1 log files (broker or server). I assume that's because it's coming from some adapter log file. Any insights? I'd prefer to use LONGCHAR where possible. CHARACTER is fine for test / R&D purposes but I can't rule out real live code returning much larger data sets (and, as I discovered, I can't directly map a Progress.Json.ObjectModel.JsonObject data type as a return value - have to do a Write() to a CHARACTER or LONGCHAR).

Continue reading...
 
Status
Not open for further replies.
Top