File APIs for Java Developers
Manipulate DOC, XLS, PPT, PDF and many others from your application.
http://aspose.com/file-tools
The moose likes Web Services and the fly likes Web service to get document / image content taking too long Big Moose Saloon
  Search | Java FAQ | Recent Topics | Flagged Topics | Hot Topics | Zero Replies
Register / Login
JavaRanch » Java Forums » Java » Web Services
Bookmark "Web service to get document / image content taking too long" Watch "Web service to get document / image content taking too long" New topic
Author

Web service to get document / image content taking too long

Jai Kshir
Greenhorn

Joined: Aug 10, 2007
Posts: 8
Hey All,

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.

Regards,
Jaideep


Sip JAVA & Code JAVA
Jai Kshir
Greenhorn

Joined: Aug 10, 2007
Posts: 8
I did not get any responses on my query so trying to simplify it -

How to pass large binary data as webservice response?
How to implement HTTP compression in weblogic to pass large binary data quickly?
Ivan Krizsan
Ranch Hand

Joined: Oct 04, 2006
Posts: 2198
    
    1
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!
Jai Kshir
Greenhorn

Joined: Aug 10, 2007
Posts: 8
I resolved the performace issue by using 'base64Binary' as return type of my service instead of 'byte', it takes 1.5 secs from previous 8 sec.
 
I agree. Here's the link: http://aspose.com/file-tools
 
subject: Web service to get document / image content taking too long