Forums Register Login

Sending and receiving a file through webservive

+Pie Number of slices to send: Send
Hi !
I am trying to send a file using webservice using JAX-RPC,
But at the client side, I am not able to read the file,

could you please give sample application..............
+Pie Number of slices to send: Send
How are you sending the file - as a SAAJ attachment? Encoded as ASCII as part of the message content? Some other way? TellTheDetails, possibly showing some relevant code excerpts.
+Pie Number of slices to send: Send
Thank you for your reply..........

my code is :

@WebMethod(operationName = "getDocument")
public File getDocument() {
//TODO write your implementation code here:
File f= new File("/home/bashok/Desktop/chaitu_resume.doc");
return f;
}
Just Iam sending a document
[ July 24, 2008: Message edited by: ashok ballu ]
+Pie Number of slices to send: Send
File is not a type that can be transferred over WS; it has meaning only on the machine where it is defined. You need to define a method that returns the actual file contents in a way that's compatible with SOAP, e.g. a base-64-encoded String of the byte[] of the file contents.
+Pie Number of slices to send: Send
Thank you ,

could please try to give any sample example for sending file, because I am new to SOA
+Pie Number of slices to send: Send
If the approach I outlined isn't what you're looking for, you might want to read the articles "Transferring files over a web service" and "Sending SOAP attachments with JAX-RPC" that are linked in the http://faq.javaranch.com/java/WebServicesFaq
+Pie Number of slices to send: Send
If you are using Axis for web services. you can use DataSource.
+Pie Number of slices to send: Send
 

Originally posted by pradeep jaladi:
If you are using Axis for web services. you can use DataSource.


You need to be more specific. A DataSource class exists in both the javax.sql and javax.activation packages. While only the latter makes sense in this context, the connection to Axis still isn't clear - please provide mode details about the solution you're proposing.
We don't have time for this. We've gotta save the moon! Or check this out:
a bit of art, as a gift, the permaculture playing cards
https://gardener-gift.com


reply
reply
This thread has been viewed 3711 times.
Similar Threads
404-tried everything
log4j error message - please send solutions
file i/o question
delete method in B & S
How to add a line break in a text file?
More...

All times above are in ranch (not your local) time.
The current ranch time is
Mar 29, 2024 00:03:21.