I have implemented a service which retrieves the contents of tiff file (having multiple pages / images in it) from FileNet IS. The function which retrieves this content has good response time, takes only 1 sec or less. However, while I am adding that content (List<Byte>) as webservice response, it is taking very long. The web service total response time equals around 5 - 6 sec.
The response looks something like -
Now as it turns out, I am definitely doing something not so good design-wise as it is taking that long, so I wanted to know how can I pass this content back to client in efficient way with quick response time.
I am getting back Byte[] ('Byte' array) from the function fetching document content. I want to populate this content as web service response, however it is not possible (?) to pass array as web service response, so I am converting to List and then passing it, as given above.
Please suggest any alternate way / good design approach to pass this content to client.
Hi!
First of all, give people some time to find, and perhaps even answer, your question. Do not expect that an answer will appear quickly, in fact, the best thing is not to count on an answer.
Sending binary data in a SOAP message is a bad idea. Instead, you want to take a look at SAAJ - SOAP with Attachments API for Java.
Additionally, I would also suggest using MTOM for larger binary attachments.
Best wishes!