@GET
@Path ("{id}")
@Produces ({"application/json", "application/xml"})
public Source getSource(@PathParam ("id") String id) throws ServiceException, UnknownSourceException {
if ("valid".equals(id)) {
Source source = new Source();
source.setId("valid");
source.setLink(URI.create("uri:some-uri"));
source.setTitle("some-title");
return source;
}
else if ("throw".equals(id)) {
throw new ServiceException("some message", "another message");
}