Hello,
I have created a rest service which takes UUID as one of the parameters
@GET
@Path("/person/{id}")
public Person getPerson(@PathParam("id")UUID id);
I have also written a MessageBodyReader for the UUID
@ConsumeMime("application/xml")
@Provider
public class UUIDProvider implements MessageBodyReader<UUID>
{
public boolean isReadable(Class<?> type, Type genericType, Annotation[]
annotations)
{
return UUID.class.isAssignableFrom(type);
}
public UUID readFrom(Class<UUID> clazz, Type t, Annotation[]
annotations,
MediaType mt, MultivaluedMap<String, String> headers,
InputStream is) throws IOException, WebApplicationException
{
...........
}
}
But due to some reason the reader is not getting invoked,here is how my
spring xml looks like
<jaxrs:server id="personService" address="/">
<jaxrs:serviceBeans>
<ref bean="personService" />
</jaxrs:serviceBeans>
<jaxrs:providers>
<bean id="uuidProvider" class="person.UUIDProvider"/>
</jaxrs:providers>
</jaxrs:server>
Any help would be appreciated.
--
View this message in context:
http://www.nabble.com/MessageBodyReader-For-UUID-tp21319272p21319272.html
Sent from the cxf-user mailing list archive at Nabble.com.