You are correct, that won’t work.
Here’s some Java code for a service that will return a line separator string regardless of your platform:
\n for Unix/Linux
\r\n for Windows
Configure the service out to a string named “lineSeparator”,
then paste the following into the body of your new getLineSeparator Java service.
The service can be invoked standalone to set a pipeline variable, or used as a transformer in a map step.
=================================================================
String lineSeparator = System.getProperty(“line.separator”);
IDataCursor pipelineCursor = pipeline.getCursor();
IDataUtil.put( pipelineCursor, “lineSeparator”, lineSeparator );
pipelineCursor.destroy();
#webMethods#Flow-and-Java-services#Integration-Server-and-ESB