SavePipelineToFile fails for type object

I have a service I am using for testing purposes. It creates a connection to an AS400, saves the pipeline to a file, then closes the connection. I can see the AS400 connection object in the pipeline, but it doesn’t get saved to the file with savePipelineToFile. The object is of type com.ibm.as400.access.AS400 and it implements the Serializable interface.

Why won’t this AS400 object, that is clearly in the pipeline, persist to the file?

objects(bytes and streams) cannot be saved from the pipeline.with .using savePipelineToFile service.You have to convert to string and save the file to disk.

HTH,
RMG.

There is a Java class com.wm.util.coder.IDataBinCoder, which will do everything the XML coder of savePipelineToFile, but serializes to a binary format and supports Java Serializable as a one of the types of object encoded.

Objects like Java Streams still can’t roundtrip, but most interesting objects do. One tricky thing is the classloading of the objects during decode time. It should be described in the API JavaDoc, but here are the interesting methods:

public IDataBinCoder()
public IDataBinCoder( ClassLoader thePriorityClassLoader )
public void encode(OutputStream os, IData data)
throws IOException, InvalidDatatypeException
public IData decode(InputStream is)
throws IOException, InvalidDatatypeException

See also com.wm.util.code.IDataCoder for some helper methods for dealing with files and byte:
public IData readFromFile(File f)
throws IOException
public void writeToFile(File f, IData pipeline)
throws IOException

It isn’t too tough to make you own savePipelineToFile.

HTH,
Fred

“It isn’t too tough to make you own savePipelineToFile.”

Sounds like a good exercise for someone to tackle and post. Any takers?