As Mark points out, you definitely do not want to convert the bytes to a string
You don’t necessarily have to write the file to the local disk at all. If you only want to show the image within another view (and not within a containing web page), you’ll want to set the response yourself to set the response bytes and the response type (which will cause the default viewer to be launched when the user’s browser supports such an action). You’ll need to create a Java service to do this:
Service: setResponse – see the gets below to see the input parms
IDataCursor idc = pipeline.getCursor();
byte[] bytes = (byte [])IDataUtil.get(idc, "bytes");
String encoding = IDataUtil.getString(idc, "encoding");
String contentType = IDataUtil.getString(idc, "contentType");
String remoteFilename = IDataUtil.getString(idc, "remoteFilename");
idc.destroy();
com.wm.net.HttpHeader httpheader = Service.getHttpResponseHeader();
if(httpheader != null)
{
if(contentType!=null && !contentType.equals(""))
httpheader.addField("content-type", contentType);
if(encoding!=null && !encoding.equals(""))
httpheader.addField("encoding",encoding);
if(remoteFilename!=null && !remoteFilename.equals(""))
httpheader.addField("content-disposition",
"inline;filename= \""+ remoteFilename+ "\"");
}
Service.setResponse(bytes);
I’ve used this to successfully send a PDF (bytes which don’t exist on disk in any form) to a browser causing Reader to launch). Should work the same for tiff’s. Just retrieve the tiff bytes from your imaging server and pass them off to the browser using the code above.
HTH
#Flow-and-Java-services#Integration-Server-and-ESB#webMethods