Why is “bytes” an Object? Based on your description, it should be byte. A byte array is not an object and using ObjectOutputStream here is probably the issue.
Assuming that the input to the service is the byte array (which will be an “object” in the pipeline–but it isn’t really) then the service to write to the file can be as simple as this (omitting try/catch for clarity):
[highlight=Java]IDataCursor pipelineCursor = pipeline.getCursor();
String filename = IDataUtil.getString(pipelineCursor, “filename”);
byte bytes = (byte)IDataUtil.get(pipelineCursor, “bytes”);
FileOutputStream fos=new FileOutputStream(filename);
fos.write(bytes);
fos.flush();
fos.close();
pipelineCursor.destroy();[/highlight]
#Integration-Server-and-ESB#Flow-and-Java-services#webMethods