I used the following code (obtained from wmusers) recently to embed my binary data in the HTTP response.
IDataCursor idc = pipeline.getCursor();
byte bytes = (byte )IDataUtil.get(idc, “bytes”);
String encoding = IDataUtil.getString(idc, “encoding”);
String contentType = IDataUtil.getString(idc, “contentType”);
String handle = IDataUtil.getString(idc, “handle”);
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(handle != null && !handle.equals(“”))
httpheader.addField(“content-disposition”,
“inline;filename= "” + handle + “"”);
}
Service.setResponse(bytes);
#webMethods#Integration-Server-and-ESB#Flow-and-Java-services