This week's giveaway is in the Android forum.
We're giving away four copies of Android Security Essentials Live Lessons and have Godfrey Nolan on-line!
See this thread for details.
The moose likes Web Services and the fly likes sending attachments from server to client Big Moose Saloon
  Search | Java FAQ | Recent Topics | Flagged Topics | Hot Topics | Zero Replies
Register / Login


Win a copy of Android Security Essentials Live Lessons this week in the Android forum!
JavaRanch » Java Forums » Java » Web Services
Bookmark "sending attachments from server to client" Watch "sending attachments from server to client" New topic
Author

sending attachments from server to client

Karthik Mohan
Greenhorn

Joined: Sep 29, 2004
Posts: 23
hi everyone,

I am currently designing a web service on Weblogic 8.1 server using weblogic workshop IDE. My requirement is to attach the backend result (results obtaind from the database) as an attachment to the SOAP message and return it back to the client.

I saw a few examples of the javax.activation.DataHandler class and also read about using SAAJ for attaching objects to a SOAP message.

Can somebody point me to concrete examples of SOAP attachments for both server and the client. I hav tried to use the examples that I read, but they did not work for me. I maybe doing something wrong, so thats why i need examples that would work to test and then adopt them in my implementation.

I could not find examples of SAAJ implementation on the server side. I would like to modify the SOAP message inside the webservice function itself rather then doing it within the handlers. The problem with using handlers is that I don't know how to access the data returned by the backend and attach it to the SOAP body. i saw few examples of doing the same using AXIS, but i am using weblogic workshop, and there are no api's to access the message context from the webservice function itself.

also, if anyone has experience designing web services using weblogic workshop, I have a few qns.

any pointers to the above topics would be really helpful.

TIA

karthik
Rr Kumaran
Ranch Hand

Joined: Sep 17, 2001
Posts: 548
there is an axis web service implementation that accepts an image transferred from client as soap request and this web service saves that image as file on the server and Sun's JAF (Java Activation Framework) is used for this purpose. Let me know if this helps and give me your personal id so that I can send code related to this and some soft copies of books that I have on weblogic web services.


RR Kumaran
SCJP 1.4
Karthik Mohan
Greenhorn

Joined: Sep 29, 2004
Posts: 23
Mostly all the examples, that i found were using Axis SOAP engine, but i could not really find examples for Weblogic.

Nritya, it would be really helpful if you could send the examples that you have and the also the e-books. Thanks a lot. My email is k_mohanas AT yahoo DOT com. If you can send me all the code that you have realted to web services that would be great too. As i would be requiring them in the future as we start building our application.

I tried using the javax.activation.DataHandler function to return the attachment object but while generating code in weblogic to be used for the client side, it gave me some error. it was late in the night ..so i might have been under the influence of sleep :-), I will check it now and reply back if it works.
[ December 17, 2004: Message edited by: Karthik M ]
 
I agree. Here's the link: http://aspose.com/file-tools
 
subject: sending attachments from server to client
 
Similar Threads
translating propertry files using saaj api
SAAJ API: recovering the SOAPMessage object from a soap message
sending large files through webservice
sending pdf or any attachment from a java webservice to java client using JAX-WS and SAAJ
SOAP Attachments in WLS 8.1 using Workshop 8.1