Please note that Axis2 (as well as other Web service frameworks) use
the DataHandler class as a convenient way of representing data of type
base64binary. DataHandler is an existing class from the Java
Activation Framework and indeed has properties for content type and
(file) name. However, this information is not sent as part of the SOAP
message and will be lost. You should do the following:
- If you use contract first, you may use the XMIME schema [1], which
extends the base64binary type to include content type information.
- If you use code first, simply add an explicit argument for the
content type to your service.

Andreas

[1] http://www.w3.org/2005/05/xmlmime

On Thu, Jun 25, 2009 at 09:15, Moritz Maedler<m...@moritz-maedler.de> wrote:
> Good morning,
>
> the Problem is, that i need to get the content-type from the
> DataHandler-Object, as
> the method should be an image-upload that should support various image-types
> like gif, png, jpeg
> and so on.
> The next idea I have, is rerender the image on the server to jpeg using
> ImageMagicks "convert" and
> delete the source image afterwards. But I think it must be possible to get
> the content-type or at least
> the original filename from the DataHandler-Object.
>
> Maybe you can tell me, how to get the ByteArrayDataSource out of the
> DataHander-Object?
>
> Thanks a lot!
>
>
>

Reply via email to