This week's book giveaway is in the Java in General forum.
We're giving away four copies of Think Java: How to Think Like a Computer Scientist and have Allen B. Downey & Chris Mayfield on-line!
See this thread for details.
Win a copy of Think Java: How to Think Like a Computer Scientist this week in the Java in General forum!
  • Post Reply
  • Bookmark Topic Watch Topic
  • New Topic

Web service to get document / image content taking too long

 
Jai Kshir
Greenhorn
Posts: 8
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
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
 
Jai Kshir
Greenhorn
Posts: 8
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
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
Posts: 2198
1
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
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
Posts: 8
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
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.
 
  • Post Reply
  • Bookmark Topic Watch Topic
  • New Topic