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 am am <ak...@yahoo.com> on 2011/03/11 22:29:19 UTC

Axis2: how to send list of datahandler?

Hi,  

I have a web service in axis2 that I can send a file to, from a WS client.
The  file is read as byte[] and then from these bytes a  
javax.activation.DataHandler is constructed. This DataHandler is send to  the 
web service as a member of an object. No problem so far.
The  DataHandler is created as a result of the declaration of byte[] in the  
class that serves as the input parameter to the web service. And so the  ADBBean 
that is created has a DataHandler as member.
Problem: I need to enhance my web service and send multiple files.
I thought if I modified the byte[]  to a -> List<byte[]> it could work (was 
hoping to get a List<DataHandler>).
Anyway, the resulting stubs created a param of type Object.
When I tried to set my list of byte[] (as  Object) I got the exception:

Exception in thread "main" org.apache.axis2.AxisFault: Unknow type can not 
serialize
    at org.apache.axis2.AxisFault.makeFault(AxisFault.java:430)
    at 
org.apache.axis2.transport.http.SOAPMessageFormatter.writeTo(SOAPMessageFormatter.java:83)

    at 
org.apache.axis2.transport.http.AxisRequestEntity.writeRequest(AxisRequestEntity.java:84)


I thought that maybe I should not be using lists so I changed to the following:

class X{
byte[] data;
}

and in the class of the request object I changed the byte[] and made as member 
X[].
This did not work either. It created an empty stub that I could not use.

How can I solve this problem? How can I modify my web service to accept multiple 
byte[] (i.e. multiple files)?

Thank you