You are viewing a plain text version of this content. The canonical link for it is here.
Posted to java-user@axis.apache.org by Azmi <az...@bii.a-star.edu.sg> on 2004/07/14 08:26:10 UTC

SAXEception: could not find deserializer for type DataHandler

Hi, Can anyone help me with this problem?

My web service and client, which includes methods for file uploading and 
downloading using
the DataHandler class was previously working with Axis 1.1 (both service 
and client use Axis).
However I have to update axis to 1.2 because of some other application 
using axis. I've recompiled
my code (both client and service) with all the jars in the axis 1.2 beta 
distribution (axis, saaj, jaxrpc etc).
The file upload/download now fails.

The exception thrown when I try to upload a file:
AxisFault
 faultCode: {http://schemas.xmlsoap.org/soap/envelope/}Server.userException
 faultSubcode:
 faultString: org.xml.sax.SAXException: Deserializing parameter 
'source':  could not find deserializer for type {GridX3}DataHandler
 faultActor:
.
.
.
Similarly when I download a file from the web service, a similar 
exception is thrown(on the client side) when it tries to deserialize.

To serialize/deserialize I use in the client code:

import org.apache.axis.encoding.ser.JAFDataHandlerDeserializerFactory;
import org.apache.axis.encoding.ser.JAFDataHandlerSerializerFactory;

as well as typemapping in the upload/download methods:

DataHandler dhSource =
            new DataHandler(new FileDataSource(localpath + filename));

call.removeAllParameters();
call.setTargetEndpointAddress(endpointURL);
call.setOperationName(new QName(webservice, "setFile"));

QName qnameAttachment = new QName(webservice, "DataHandler");
call.registerTypeMapping(
            dhSource.getClass(),
            qnameAttachment,
            JAFDataHandlerSerializerFactory.class,
            JAFDataHandlerDeserializerFactory.class);

and in the deployment descriptor I wrote:

<typeMapping
    qname="ns2:DataHandler"
    languageSpecificType="java:javax.activation.DataHandler"
    
serializer="org.apache.axis.encoding.ser.JAFDataHandlerSerializerFactory"
    
deserializer="org.apache.axis.encoding.ser.JAFDataHandlerDeserializerFactory"
    encodingStyle="http://schemas.xmlsoap.org/soap/encoding/"
  />


Since no exception is thrown when the file is being serialized, I gather 
that it's succesful. Thus, why
does it fail when its trying to deserialize??

Any help please?


Thanks,
Azmi

Re: SAXEception: could not find deserializer for type DataHandler

Posted by Davanum Srinivas <da...@gmail.com>.
please try the latest beta (check mail archives) and if you still have
a problem, please open a bug report with sample code (to recreate the
problem)

thanks,
dims

On Mon, 19 Jul 2004 08:05:11 +0800, Azmi <az...@bii.a-star.edu.sg> wrote:
> I haven't gotten a response for my problem.
> Probably, cos it got lost in the multitude of postings :)
> So I apologize for reposting this and thank anyone who can help me.
> 
> Azmi wrote:
> 
> > Hi, Can anyone help me with this problem?
> >
> > My web service and client, which includes methods for file uploading
> > and downloading using
> > the DataHandler class was previously working with Axis 1.1 (both
> > service and client use Axis).
> > However I have to update axis to 1.2 because of some other application
> > using axis. I've recompiled
> > my code (both client and service) with all the jars in the axis 1.2
> > beta distribution (axis, saaj, jaxrpc etc).
> > The file upload/download now fails.
> >
> > The exception thrown when I try to upload a file:
> > AxisFault
> > faultCode:
> > {http://schemas.xmlsoap.org/soap/envelope/}Server.userException
> > faultSubcode:
> > faultString: org.xml.sax.SAXException: Deserializing parameter
> > 'source':  could not find deserializer for type {GridX3}DataHandler
> > faultActor:
> > .
> > .
> > .
> > Similarly when I download a file from the web service, a similar
> > exception is thrown(on the client side) when it tries to deserialize.
> >
> > To serialize/deserialize I use in the client code:
> >
> > import org.apache.axis.encoding.ser.JAFDataHandlerDeserializerFactory;
> > import org.apache.axis.encoding.ser.JAFDataHandlerSerializerFactory;
> >
> > as well as typemapping in the upload/download methods:
> >
> > DataHandler dhSource =
> >            new DataHandler(new FileDataSource(localpath + filename));
> >
> > call.removeAllParameters();
> > call.setTargetEndpointAddress(endpointURL);
> > call.setOperationName(new QName(webservice, "setFile"));
> >
> > QName qnameAttachment = new QName(webservice, "DataHandler");
> > call.registerTypeMapping(
> >            dhSource.getClass(),
> >            qnameAttachment,
> >            JAFDataHandlerSerializerFactory.class,
> >            JAFDataHandlerDeserializerFactory.class);
> >
> > and in the deployment descriptor I wrote:
> >
> > <typeMapping
> >    qname="ns2:DataHandler"
> >    languageSpecificType="java:javax.activation.DataHandler"
> >
> > serializer="org.apache.axis.encoding.ser.JAFDataHandlerSerializerFactory"
> >
> > deserializer="org.apache.axis.encoding.ser.JAFDataHandlerDeserializerFactory"
> >
> >    encodingStyle="http://schemas.xmlsoap.org/soap/encoding/"
> >  />
> >
> >
> > Since no exception is thrown when the file is being serialized, I
> > gather that it's succesful. Thus, why
> > does it fail when its trying to deserialize??
> >
> > Any help please?
> >
> >
> > Thanks,
> > Azmi
> >
> >
> 
> 


-- 
Davanum Srinivas - http://webservices.apache.org/~dims/

Re: SAXEception: could not find deserializer for type DataHandler

Posted by Azmi <az...@bii.a-star.edu.sg>.
I haven't gotten a response for my problem.
Probably, cos it got lost in the multitude of postings :)
So I apologize for reposting this and thank anyone who can help me.

Azmi wrote:

> Hi, Can anyone help me with this problem?
>
> My web service and client, which includes methods for file uploading 
> and downloading using
> the DataHandler class was previously working with Axis 1.1 (both 
> service and client use Axis).
> However I have to update axis to 1.2 because of some other application 
> using axis. I've recompiled
> my code (both client and service) with all the jars in the axis 1.2 
> beta distribution (axis, saaj, jaxrpc etc).
> The file upload/download now fails.
>
> The exception thrown when I try to upload a file:
> AxisFault
> faultCode: 
> {http://schemas.xmlsoap.org/soap/envelope/}Server.userException
> faultSubcode:
> faultString: org.xml.sax.SAXException: Deserializing parameter 
> 'source':  could not find deserializer for type {GridX3}DataHandler
> faultActor:
> .
> .
> .
> Similarly when I download a file from the web service, a similar 
> exception is thrown(on the client side) when it tries to deserialize.
>
> To serialize/deserialize I use in the client code:
>
> import org.apache.axis.encoding.ser.JAFDataHandlerDeserializerFactory;
> import org.apache.axis.encoding.ser.JAFDataHandlerSerializerFactory;
>
> as well as typemapping in the upload/download methods:
>
> DataHandler dhSource =
>            new DataHandler(new FileDataSource(localpath + filename));
>
> call.removeAllParameters();
> call.setTargetEndpointAddress(endpointURL);
> call.setOperationName(new QName(webservice, "setFile"));
>
> QName qnameAttachment = new QName(webservice, "DataHandler");
> call.registerTypeMapping(
>            dhSource.getClass(),
>            qnameAttachment,
>            JAFDataHandlerSerializerFactory.class,
>            JAFDataHandlerDeserializerFactory.class);
>
> and in the deployment descriptor I wrote:
>
> <typeMapping
>    qname="ns2:DataHandler"
>    languageSpecificType="java:javax.activation.DataHandler"
>    
> serializer="org.apache.axis.encoding.ser.JAFDataHandlerSerializerFactory"
>    
> deserializer="org.apache.axis.encoding.ser.JAFDataHandlerDeserializerFactory" 
>
>    encodingStyle="http://schemas.xmlsoap.org/soap/encoding/"
>  />
>
>
> Since no exception is thrown when the file is being serialized, I 
> gather that it's succesful. Thus, why
> does it fail when its trying to deserialize??
>
> Any help please?
>
>
> Thanks,
> Azmi
>
>