Hi

Try implementing MultipartInputFilter, ex:
https://github.com/apache/cxf/blob/master/rt/rs/security/jose-parent/jose-jaxrs/src/main/java/org/apache/cxf/rs/security/jose/jaxrs/multipart/JwsMultipartSignatureInFilter.java

and then register it from your interceptor like this:

https://github.com/apache/cxf/blob/master/rt/rs/security/jose-parent/jose-jaxrs/src/main/java/org/apache/cxf/rs/security/jose/jaxrs/multipart/AbstractJwsMultipartVerificationFilter.java#L45

It's quite new, should be avail starting from 3.1.14

Sergey
On 06/12/17 17:10, narayanasgs wrote:
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