hi All,
My service has a method - saveJPEG(String name, java.awt.Image img)
taking a name and a jpeg image and saving that jpeg with that name in a
specified directory.
I am using SOAP RPC. Since there is no Serializer/Deserializer for Image
type, i created my ImageSerializerDeserializer. The DD specifies this
info. The client also does the mapTypes with this info. What I do in
this class is - in the marshall method, i take the Image source, convert
it into a DataHandler object and call the MimePartSerializer with the
DataHandler object (i simply pass all the other parameters onto
MimePartSerializer - only the src is changed to dhsrc).
In the unmarshall method - i first call the
MimePartSerializer.unmarshall method and get the Bean. Since i know it
is Image, i convert the DataHandler value in this bean to an Image
object and create and return that Image bean.
So the client works fine now - my ImageSerializer's marshall method gets
called and the call goes through to the Server. The problem is in the
Deserialization. My ImageSerializer class's unmarshall method is never
called at the server end. Always the MimePartSerializer.unmarshall is
called and I get a fault saying there is no such method that accepts a
DataHandler - saveJPEG(java.lang.String,javax.activation.DataHandler).
What is the problem here? Is there a way to override the deserializer
for javax.activation.DataHandler? Is my approach correct?
(I know i can have an overloaded method with this signature taking the
data handler and in this method convert the dh to image and call my
original method. But this is not what i am looking for.)
I appreciate any help in this.
thanks a lot in advance,
Vamsi.
The DD entry is -
<isd:map encodingStyle="http://schemas.xmlsoap.org/soap/encoding/"
xmlns:x="urn:xml-soap-j2eeca-soapattach-serverSaveJPEG"
qname="x:Image"
javaType="java.awt.Image"
java2XMLClassName="soapattach.soap.serializers.ImageSerializer"
xml2JavaClassName="soapattach.soap.serializers.ImageSerializer" />
--
To unsubscribe, e-mail: <mailto:[EMAIL PROTECTED]>
For additional commands, e-mail: <mailto:[EMAIL PROTECTED]>
- Re: Can I override the MimePartSerializer?? - Need Help Soon Vamsi Krishna
- Re: Can I override the MimePartSerializer?? - Need Help... Scott Nichol
- Re: Can I override the MimePartSerializer?? - Need ... Vamsi Krishna