Hi
Perhaps no provider is found for Device given that you;re passing an
explicit collection ? Is device a JAXB bean ?
Additionally, you may want to drop an empty @Multipart - it is meant to
identify 'bind' a given method parameter to a multi-part with a matching
Content-Id and optionally a matching content type...
If it is a jaxb bean and still does not work then try
@Consumes("multipart/form-data;type=text/xml")
let me know please if it works
cheers, Sergey
On Tue, Oct 5, 2010 at 5:52 PM, oceanz <[email protected]> wrote:
>
> Hi,
>
> I am trying to pass a list of objects using muliparts. Below is the code:
>
> UserService userService = (UserService)
> JAXRSClientFactory.create("http://localhost:8080/sitexchange/services
> ",UserService.class);
> userService.addDevice3(list);
>
>
> @Path("user/site/plant/device/addDevice1")
> @POST
> @Produces("text/xml")
> @Consumes("multipart/form-data")
> Device addDevice1(@Multipart("")List<Device> device);
>
> But I get an exception as below. Can anyone guide me as to what am I
> missing.
>
> org.apache.cxf.interceptor.Fault
> at
>
> org.apache.cxf.jaxrs.client.ClientProxyImpl$BodyWriter.handleMessage(ClientProxyImpl.java:523)
> at
>
> org.apache.cxf.phase.PhaseInterceptorChain.doIntercept(PhaseInterceptorChain.java:243)
> at
>
> org.apache.cxf.jaxrs.client.ClientProxyImpl.doChainedInvocation(ClientProxyImpl.java:438)
> at
>
> org.apache.cxf.jaxrs.client.ClientProxyImpl.invoke(ClientProxyImpl.java:177)
> at $Proxy20.addDevice3(Unknown Source)
> at com.esei.services.wsTest.main(wsTest.java:51)
> Caused by: javax.ws.rs.WebApplicationException
> at
>
> org.apache.cxf.jaxrs.client.AbstractClient.reportNoMessageHandler(AbstractClient.java:487)
> at
>
> org.apache.cxf.jaxrs.client.AbstractClient.writeBody(AbstractClient.java:401)
> at
>
> org.apache.cxf.jaxrs.client.ClientProxyImpl$BodyWriter.handleMessage(ClientProxyImpl.java:514)
> ... 5 more
> Exception in thread "main" org.apache.cxf.interceptor.Fault
> at
>
> org.apache.cxf.jaxrs.client.ClientProxyImpl$BodyWriter.handleMessage(ClientProxyImpl.java:523)
> at
>
> org.apache.cxf.phase.PhaseInterceptorChain.doIntercept(PhaseInterceptorChain.java:243)
> at
>
> org.apache.cxf.jaxrs.client.ClientProxyImpl.doChainedInvocation(ClientProxyImpl.java:438)
> at
>
> org.apache.cxf.jaxrs.client.ClientProxyImpl.invoke(ClientProxyImpl.java:177)
> at $Proxy20.addDevice3(Unknown Source)
> at com.esei.services.wsTest.main(wsTest.java:51)
> Caused by: javax.ws.rs.WebApplicationException
> at
>
> org.apache.cxf.jaxrs.client.AbstractClient.reportNoMessageHandler(AbstractClient.java:487)
> at
>
> org.apache.cxf.jaxrs.client.AbstractClient.writeBody(AbstractClient.java:401)
> at
>
> org.apache.cxf.jaxrs.client.ClientProxyImpl$BodyWriter.handleMessage(ClientProxyImpl.java:514)
> --
> View this message in context:
> http://cxf.547215.n5.nabble.com/Help-required-with-apache-cxf-multiparts-tp3199975p3199975.html
> Sent from the cxf-user mailing list archive at Nabble.com.
>