axis-java-user mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From "Takanori Suzuki" <takano...@gmail.com>
Subject [Axis2] multipart/form-data problem at the RESTFul Service
Date Thu, 06 Dec 2007 14:39:23 GMT
Hi, I'm using Axis2 1.3.

If a enctype="multipart/form-data request is sent by HTTP POST,
I get the following exception:

java.lang.ClassCastException: [Ljava.lang.String;
	at org.apache.axis2.builder.BuilderUtil.createSOAPMessageWithoutSchema(BuilderUtil.java:183)
	at org.apache.axis2.builder.BuilderUtil.buildsoapMessage(BuilderUtil.java:130)
	at org.apache.axis2.builder.MultipartFormDataBuilder.processDocument(MultipartFormDataBuilder.java:56)
	at org.apache.axis2.transport.TransportUtils.createDocumentElement(TransportUtils.java:160)
	at org.apache.axis2.transport.TransportUtils.createSOAPMessage(TransportUtils.java:111)


It is a MultipartFormDataBuilder bug, isn't it?

MultipartFormDataBuilder
------------------------------------------------------------
    private MultipleEntryHashMap getParameterMap(HttpServletRequest request)
            throws FileUploadException {

        MultipleEntryHashMap parameterMap = new MultipleEntryHashMap();

        List items = parseRequest(new ServletRequestContext(request));
        Iterator iter = items.iterator();
        while (iter.hasNext()) {
            String[] value = new String[1];
            DiskFileItem diskFileItem = (DiskFileItem) iter.next();
            value[0] = diskFileItem.getString();
            parameterMap.put(diskFileItem.getFieldName(), value);
        }

        return parameterMap;
    }
------------------------------------------------------------

the "value" type is String array.
But BuilderUtil expect String.


-----
Thanks,
Takanori

---------------------------------------------------------------------
To unsubscribe, e-mail: axis-user-unsubscribe@ws.apache.org
For additional commands, e-mail: axis-user-help@ws.apache.org


Mime
View raw message