JAX-RS & CXF map request to method based on XML?

It's impossible to do it this way. The reason is simple: CXF (as any other JAX-RS framework) routs the responses based on REST definitions and not based on object oriented principals. I mean that it selects the method based on URL, produced content type and consumed content type.(This is simplified description, see the JSR311 for exact algorithm).

But it has nothing to do with objects you expect. Objects are getting serialized only after the method is already selected. This is the reason you are getting the exception: createGeothing(@PathParam("{id}") Long id, PolygonGeothing geothing) is selected, so it tries to serialize the wrong class.

It's impossible to do it this way. The reason is simple: CXF (as any other JAX-RS framework) routs the responses based on REST definitions and not based on object oriented principals. I mean that it selects the method based on URL, produced content type and consumed content type.(This is simplified description, see the JSR311 for exact algorithm).

But it has nothing to do with objects you expect. Objects are getting serialized only after the method is already selected. This is the reason you are getting the exception: createGeothing(@PathParam("{id}") Long id, PolygonGeothing geothing) is selected, so it tries to serialize the wrong class.

You can do the following: Response createGeothing(@PathParam("{id}") Long id, Geothing geothing) and than cast and call the relevant method. Of course you need to make sure that Geothing is known to JAXB context.

I cant really gove you an answer,but what I can give you is a way to a solution, that is you have to find the anglde that you relate to or peaks your interest. A good paper is one that people get drawn into because it reaches them ln some way.As for me WW11 to me, I think of the holocaust and the effect it had on the survivors, their families and those who stood by and did nothing until it was too late.

Related Questions