On Wednesday 10 November 2010 1:37:08 pm Sergey Beryozkin wrote: > > Yes that was an example. But it says that /services give you a list of > > all available webservices in WADL format. > > Only if a CXFServlet is used. We do block custom services exposing their > own /services. Note when CXFServlet is used it is possible to configure it > to let "/services" requests pass through but react to some other path > value for displaying the services page.
I kind of keep thinking that someday, it might make sense to re-write the Jetty stuff to use the CXFServlet directly which would solve this issue. Just not something I've had time to really pursue or even spend more than a passing thought on. Dan > > > For a start, the fact that "http://mypc:9000?_wadl" is not giving you a > > wadl > > > > > instance describing all the root resources is a bug most likely to do > > > > with > > > > > the fact the embedded Jetty is used - I'll verify. You may actually > > > want > > > > to > > > > > try "http://mypc:9000/?_wadl", note the trailing forward slash. I've > > > > fixed > > > > > an http-transport level bug a couple of days ago to do with some > > > > ambiguity > > > > > in cases with trailing forward slashes, only exposed when certain > > > address combinations were used. > > > > Same result with the slash > > > > It works for me - but the issue will need to be investigated further. > > > > > Now, I'm not exactly sure about say > > > > > > /catalog/CatalogService (class-level: "/api/v1.0/catalog", > > > > function-level: > > > "/{id}" and "/{id}/delete" and "/{id}/add") > > > > > > what is "/catalog/CatalogService" ? it appears that all the root > > > > resources > > > > > start from "/api/" ? > > > It is much simpler to understand what is going on when a sample > > > resource class with relevant bits is posted... > > > > Ok, here is a bit of code > > > > // > > // Class VersionService > > // > > package com.foo.bar.api; > > > > @Path("/api/versions") > > public class VersionService { > > > > @GET > > @Path("/") > > @Produces(MediaType.TEXT_XML) > > public JAXBElement<SupportedVersionsType> getVersions() { > > > > ObjectFactory myFactory = new ObjectFactory(); > > ... > > return myFactory.createSupportedVersions(supportedVersions); > > > > } > > > > } > > > > // > > // Class LoginService > > // > > package com.foo.bar.login; > > > > @Path("/api/v1.0/login") > > public class LoginService { > > > > @POST > > @Path("/") > > @Produces("application/vnd.foo.bar.login+xml") > > public JAXBElement<ListType> login() { > > > > ObjectFactory myFactory = new ObjectFactory(); > > ... > > return myFactory.createOrgList(list); > > > > } > > > > } > > > > // > > // Class CatalogService > > // > > package com.foo.bar.catalog; > > > > @Path("/api/v1.0/catalog/") > > public class CatalogService { > > > > @GET > > @Path("/{id}") > > @Produces("application/vnd.foo.bar.catalog+xml") > > public JAXBElement<CatalogType> getContent(@PathParam("id") String id) > > { > > > > ObjectFactory myFactory = new ObjectFactory(); > > ... > > return myFactory.createCatalog(cat); > > > > } > > > > @POST > > @Path("/{id}/action/upload") > > @Consumes("application/vnd.foo.bar.uploadParams+xml") > > @Produces("application/vnd.foo.bar.catalog+xml") > > public JAXBElement<CatalogType> upload(@PathParam("id") String id, > > > > UploadParamsType params) { > > ObjectFactory myFactory = new ObjectFactory(); > > ... > > return myFactory.createCatalog(catType); > > > > } > > > > @POST > > @Path("/{id}/media") > > @Consumes("application/vnd.foo.bar.media+xml") > > @Produces("application/vnd.foo.bar.media+xml") > > public JAXBElement<MediaType> uploadMediaImage(@PathParam("id") String > > > > id, MediaType mediaParam) { > > ObjectFactory myFactory = new ObjectFactory(); > > ... > > return myFactory.createMedia(mediaType); > > > > } > > > > } > > > > The API is given, I cannot change it. > > > > Is the package organisation a problem? Or the "/api" prefix? > > No... > > cheers, Sergey -- Daniel Kulp [email protected] http://dankulp.com/blog
