Question
· Jan 25

I am getting ASTM messages in a single line instead of different lines like H|..../rQ|..../rL in the service. How can I resolve it?

I've modified the class file, but messages still arrive as a single line (e.g., "H|.../rQ|.../rL") instead of separate lines in the ASTM service. The <ENQ>..<EOT> header looks correct, logs show no errors, and the service receives messages fine. Is there an Ensemble 2018.1 engine setting (like line terminator handling or TCP framing) to fix the line splitting? ​

Product version: Caché 2018.1
Discussion (2)2
Log in or sign up to continue

Hey Jainam.

I don't get a lot of hands on time with ASTM messaging but, from what you've shared, what you're receiving is using carriage returns.

The TCP Adapter does have a property of "Terminators" that is set to use ASCII Character 10 (line feed) for this, but this value is not configurable from the management portal (which is stated in the documentation)

I'm not sure if this is what you have tried where you stated "I've modified the class file", and I can't say for sure if this will work as I have no way to test it locally, but you could try creating a custom adapter which extends the in built adapter and overwrite the property, and then creating a custom service which extends the in built service and uses the custom adapter.

Something like:

Class Custom.EDI.ASTM.Adapter.TCPAdapter Extends EnsLib.EDI.ASTM.Adapter.TCPAdapter
{
/// Overwriting the original value of $C(10) (line feed) with $C(13) (carriage return)
Property Terminators As %String [ InitialExpression = {$C(13)} ];
}

and 

Class Custom.EDI.ASTM.Service.TCPService Extends EnsLib.EDI.ASTM.Service.TCPService
{

Parameter ADAPTER = "Custom.EDI.ASTM.Adapter.TCPAdapter";

}

And finally, use the custom service in your production.

If this doesn't work, you might need to look into what your sending system is actually outputting for the carriage returns/line feeds.