Hi Brice
Thanks for your comments.
Hello,
I have question regarding annotation inheritance.
Imagine we have an API with a model and an interface with exposed methods
like:
=====================================================
@Path("/customerrestservice/")
@ProduceMime("application/xml")
public interface RestService {
@GET
@Path("customer")
Customer getCustomer(@QueryParam("name") String name);
@GET
@Path("vendor")
Vendor getVendor(@QueryParam("profession") String profession);
@GET
@Path("/customerrestservice/vendors/{profession}/{name}")
@ProduceMime("application/xml")
Vendor getVendor(@PathParam("profession") String profession,
@PathParam("name") String name);
@GET
@Path("vendors")
Set<Person> getPersons();
}
=====================================================
And a CXF implementation of this interface
=====================================================
@Path("/customerrestservice/")
@ProduceMime("application/xml")
public class RestServer implements RestService {
[snipped]
}
=====================================================
The wiki on the JSR 311 says that annotations are inherited, ok. But
apparently the annotations on the interface itself aren't inherited!
Actually with CXF 2.1.1, it is the annotations on the implementation that
the factory uses.
Then if for some reason the path changes in either the API or in the
implementation, any client is doomed, because again it is the annotations on
the implementing class that are taking into account.
Or for example if an implementer forgot to add the @ProduceMime annotation,
then the server will not add in the HTTP headers the MIME type.
Both superclass and interface annotations are inherited. The only limitation on the trunk at the moment is that class-level
interface annotations are not inherited, only method level ones are. JAX-RS actually allows only method-level annotations be
inherited, and it's not clear yet what exactly the final recommnedation will say in this regard. That said, CXF JAX-RS will support
both class-level and method level annotation inheritance for both super-classes and interfaces.
On another topic, is it possible to use properties in a http:conduit bean
definition.
With Spring there is a propertyplaceholder who can propagate properties,
however the XSD doesn't accept strings it is then impossible to write a
property value like "${rest.service.password}".
I think it could be really nice to relax a bit the XSD in order to benefit
the Spring property placeholder!
Can you please explain a bit more ? Possibly using some sample spring
configuration ?
And last question, do you plan to create JAXRSClient factory bean, right
know using the JaxWsPRoxyFactoryBean is a bit intricate when declaring it in
a Spring application context and setting properties like setWrapped.
Please expand on it a bit more too.
Cheers, Sergey
Thx in advance for your answers.
Btw CXF is really a Great work :)
--
Brice Dutheil
----------------------------
IONA Technologies PLC (registered in Ireland)
Registered Number: 171387
Registered Address: The IONA Building, Shelbourne Road, Dublin 4, Ireland