Registering writers
In your code, add the entity writer to the appropriate registry. This only needs to be done once per session, so it's recommended to do this duriung session startup.
USING OpenEdge.Net.HTTP.Filter.Writer.EntityWriterRegistry.
USING Example.Writer.ExtendedJsonEntityWriter.
// The HTTP client (and certain webhandlers) will now use the ExtendedJsonEntityWriter
// for all JSON content
EntityWriterRegistry:Registry:Put('application/json':u,
get-class(ExtendedJsonEntityWriter)).
The Registry property is an instance of the OpenEdge.Core.Util.BuilderRegistry type, which is a map of characters (keys) and Progress.Lang.Class instances (values). There are Get, Put, Remove and Clear methods, as well Has and a Size property for registry inspection.
Examples (attached)
| File name | Description | Comments |
|---|
ExtendedJsonEntityWriter.cls | Writes JSON as Progress.ObjectModel.JsonConstruct and certain primitive types | |
test_ext_writer.p | Example of registering the writer and calling it |