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 post file by webservice 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 post file by webservice" Watch "How to post file by webservice" New topic

How to post file by webservice

swenling wen
Ranch Hand

Joined: Jun 07, 2006
Posts: 32
I will post a file by webservice,my development enviroment uses cxf and tomcat.
I read file into byte stream,and client receive it.
Does that have some exception when post byte stream by webservice?
can you give me code?
William Brogden
Author and all-around good cowpoke

Joined: Mar 22, 2000
Posts: 13037
The simplest way to provide a file through a web service is to use the REST style with GET. The CXF toolkit docs say they support REST style but I have not tried it.

Are there particular requirements for using SOAP and WSDL in your application? If not the Jersey open source RESTful implementation will be simpler.

karthikeyan Chockalingam
Ranch Hand

Joined: Sep 06, 2003
Posts: 259

The above link explains how to upload a file using CXF and Tomcat. If client needs to receive the attachment [download], please follow the reverse logic. In case you need further assistance please let me know.
[ June 09, 2008: Message edited by: karthi keyan ]

I agree. Here's the link:
subject: How to post file by webservice
It's not a secret anymore!