Hi

You can definitely have multiple jaxrs:server endpoints with endpoint specific providers. The issue is that you'd like to have all of them to share the same address which is not possible.

Do server-specific service beans have root @Path values which would stay unique even if you collapsed all the service beans under a single jaxrs:server ?

Another question : given you'd like jaxrs:server endpoints share the same address, what would actually act as a differentiator, as far as client requests are concerned ?

If every service bean across all the jaxrs:server endpoints has a unique root @Path and say every client request has, say, a ClientId query header uniquely identifying a client then the simplest way to solve the issue is to have a single jaxrs:server including all the service beans and have a custom MessageBodyReader/Writer implemented as follows :

@Context UriInfo uriInfo; // or HttpHeaders

// this map is initialized at startup,
Map<ClientHeaderValue, JAXBElementProvider> map...;
// get client id from a header/uri and delegate to appropriate  
JAXBElementProvider in readFrom/writeTo
...

This assumes you know in advance what types of clients can access the service...

Will this work ?
If not then can you provide more details please ?

thanks, Sergey

----- Original Message ----- From: "Sertic Mirko, Bedag" <[email protected]>
To: <[email protected]>
Sent: Tuesday, January 26, 2010 3:39 PM
Subject: multiple raxrs:server with same address


h...@all



I'd like to know if it's valid to have multiple jaxrs:server elements
with the same address.



Every server has a set of different service beans. The reason why I want
to have multiple server configurations is to have different
JAXBElementProvider for each server.

Is this valid, and what are common pitfalls?



Thanks in advance

Mirko




Reply via email to