This week's book giveaway is in the Jobs Discussion forum.
We're giving away four copies of Java Interview Guide and have Anthony DePalma on-line!
See this thread for details.
The moose likes Web Services and the fly likes How-to Pass Images using Web services? Big Moose Saloon
  Search | Java FAQ | Recent Topics | Flagged Topics | Hot Topics | Zero Replies
Register / Login

Win a copy of Java Interview Guide this week in the Jobs Discussion forum!
JavaRanch » Java Forums » Java » Web Services
Bookmark "How-to Pass Images using Web services?" Watch "How-to Pass Images using Web services?" New topic

How-to Pass Images using Web services?

arya putra

Joined: Apr 27, 2004
Posts: 16
Hello folks,
I am using Tomcat and axis for web services.
I am taking some images using a webcam which my client program suppose to display. One of the problems am facing is how pass an Image taken by the webcam using SOAP to my client program. One possible solution that I thought of is to convert the Image to a byte array and pass it and then convert back to Image at the client side. But before doing so I would like to be sure.
Did any one handle this or similar kind of issue before? Or if someone has any other idea?
Please get back!!!
Thanks in return.
William Brogden
Author and all-around good cowpoke

Joined: Mar 22, 2000
Posts: 13037
A byte array will work - note that it will be base64 encoded because some bytes can't legally be part of XML messages.
arya putra

Joined: Apr 27, 2004
Posts: 16
Hi Bill,
Thanks for getting back!!! I am a core C programmer and recently plunged to JAVA world!!! I just got this idea but I dont know how to go for it!! Any idea of any useful class which I could use for my objective!!!
Thanks a lot!!!
Lasse Koskela

Joined: Jan 23, 2002
Posts: 11962
Someone recently posted about having uploaded a Base64 implementation as an open source project to

Author of Test Driven (2007) and Effective Unit Testing (2013) [Blog] [HowToAskQuestionsOnJavaRanch]
I agree. Here's the link:
subject: How-to Pass Images using Web services?
It's not a secret anymore!