Hi,

I am creating a RESTful file upload using CXF. The method is crated as below
and I am able to test it from Fiddler and via a HTML form with
enctype='multipart/form-data'. 

I need to access one of these multipart data in the interceptor that
implements AbstractPhaseInterceptor with Phase.PRE_INVOKE. 

I tried using Apache Commons File upload 1.2.2 to read multipart data but
got this error: org.apache.commons.fileupload.FileUploadException: Stream
closed. 

Please help me with details of how to access any of these multipart
attributes like code, desc etc in interceptor.  


Web service method:
@POST
    @Path("addAttachment")
        @Consumes({MediaType.MULTIPART_FORM_DATA})
        public int addAttachment(@Multipart(value = "id", type = "text/plain")
Integer ID,
                        @Multipart(value = "code", type = "text/plain") Integer 
code,
                        @Multipart(value = "desc", type = "text/plain") String 
desc,
                        MultipartBody multipartBody) throws WebServiceFault {
}

Thanks in advance. 



--
Sent from: http://cxf.547215.n5.nabble.com/cxf-user-f547216.html

Reply via email to