Hi all,
I've got the following code in a webservice that generates a PDF:
// Create a ServletOutputStream object
ServletOutputStream oOutput = objResponse.getOutputStream();
// Set the HTTPResponse objects content type
objResponse.setContentType(objMyOutputContext.getContentType());
// Get the length of the output stream
int outLength = objMyOutputContext.getOutputContent().length;
// Create a byte array and allocate outLength bytes
byte[] cContent = new byte[outLength];
// Populate the byte array by invoking getOutputContext
cContent = objMyOutputContext.getOutputContent();
// Write a byte stream back to the web browser. Pass the byte array
oOutput.write(cContent);
The problem is that I don't know how to pass the HttpServletResponse object (objResponse) to the WebService so I can obtain the ServletOutputStream which is needed to create the PDF form in a web browser. When I pass this object there's an error because this type of parameter is not serializable.
Can anyone help? Does anyone know how to serialize this object? Is there any other possibility to generate a PDF form using a webservice with a serializable parameter?
Thanks