Win a copy of Re-engineering Legacy Software this week in the Refactoring forum
or Docker in Action in the Cloud/Virtualization forum!
  • Post Reply
  • Bookmark Topic Watch Topic
  • New Topic

How to post file by webservice

 
swenling wen
Ranch Hand
Posts: 32
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
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?
Thanks!
 
William Brogden
Author and all-around good cowpoke
Rancher
Posts: 13056
6
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
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.

Bill
 
karthikeyan Chockalingam
Ranch Hand
Posts: 259
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
http://theasolutions.com/tutorials/cxfuploadattachment.jsp

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 ]
 
Don't get me started about those stupid light bulbs.
  • Post Reply
  • Bookmark Topic Watch Topic
  • New Topic