Hi Toshiyuki
My Answers are as below
Axis 1.0 (But we may go for Apache Soap latest version comes with websphere 4.0)
Type of Image (Jpeg). We get the image as byte array from other source. We do not get
file reference.
Problem. If i expose my ejb method as webservice interface and i have to use soap with
attachment then the return type of EJB method will be of Datahandler Type. But
DataHandler can not be return type of an ejb method as it does not implement
java.io.serializable and all ejb retutn parameters needs to be serializable.
So to avoid this i was thinking that let my ejb return byte array and i have to write
a wrapper java class which will convert the byte array to datahandler (still no clear
how to convert that). The wrapper java class will be exposed as web service rather
than exposing the ejb as webservice.
Let me know whethere i am procceding in a correct direction.
Thanks,
Subhendu
-----Original Message-----
From: Toshiyuki Kimura [mailto:[EMAIL PROTECTED]
Sent: Tuesday, March 25, 2003 6:27 AM
To: [EMAIL PROTECTED]
Subject: Re: help required for attachment using ejb as webservice provider
Hi Subhendu,
In order to clear questions from you, we'll need more details of
your situation;
- Version of AXIS: 1.0, 1.1Beta, RC1, RC2, or the current ver ?
- Type of Image : 'JPEG', 'GIF', or the other specific types ?
- Real problem : 'Exceptions', or 'Functionally defectives' ?
If you're using AXIS 1.1 Beta (or the later) and 'image/jpeg
or image/gif' as the content type (i.e. your image archive only
has JPEG files and/or GIF files), you might make it with the
following snapshot;
public DataHandler downladFile(java.lang.String filename){
try{
FileDataSource dataSource = new FileDataSource(filename);
DataHandler dataHandler = new DataHandler(dataSource);
return dataHandler;
}catch(Exception e){
:
}
}
Please note DataHandler hasn't been implemented as serializable,
however, some standardized types of content (MIME type) will be
automatically serialized and deserialized by the runtime, AXIS
with your right configuration.
Best Regards,
Toshi (Toshiyuki Kimura) <[EMAIL PROTECTED]>
R&D Headquarters
NTT DATA Corporation
-----Original Message-----
From: subhendukumar mohanty [mailto:[EMAIL PROTECTED]
Sent: Friday, March 21, 2003 10:05 AM
To: [EMAIL PROTECTED]
Subject: help required for attachment using ejb as
webservice provider
We are creating a ejb which will be exposed as webservice.
One of the method of ejb will return the image from image
archive. So we need to use soap with attachment for this.
I learned that if any data is returned using DataHandler
it will be automatically passed as soap with attachment.
As DataHandler is not implemented java.io.serializable,
I can not use this as the return type of the ejb. I am new
to webservice and axis. So any body can guide me what to do
in this case..
Your help will be appreciated.
Thanks,
Subhendu