0

I need to develop a web-service. Purpose of this service is read a oracle blob field(stores image file) and send to the client. Do you think which format is suitable for this blob field. If i send byteArray type, can client convert this to image. This method easy i can do that but according to the my google research image files or other file types can be sent url download link. Which is more sensible? My environment: j2ee,cxf,eclipse,soap

erarat
  • 156
  • 2
  • 9
  • Read this http://stackoverflow.com/questions/4377589/how-do-i-send-a-file-with-jax-rs. That shows how to do it with jaxrs. – Mike Thomsen Jan 30 '13 at 12:53
  • Thank you but this post is not related blob and soap. – erarat Jan 30 '13 at 13:28
  • A byte array (in the correct format) *is* an image. Everything in a computer is a bunch of bytes. The only other thing you might want to send along is a MIME type to tell which kind of image the bytes are. – millimoose Jan 30 '13 at 13:34

1 Answers1

0

In your wer-service read it as BLOB and then to Byte Array.

but to send it in response, you may need to put it in a proper content-type i.e either "image/jpeg" or "image/png" or whatever is right.

And also , you may need to send it as attachment in your response.

If its SOAP service then, SOAP with Attachement

TheWhiteRabbit
  • 15,480
  • 4
  • 33
  • 57