Hi , I am using cxf as a webservice.It supports xml and json format output of the requested data.I want to know that if some exception has occured in my code then i want to return him back the error code either in xml or json format.But i dont know when to give json and xml ,it depends on the requested url that user has asked.
example
@Path("/reports/ad-view/loginId/{loginId}/publisher/")
PublisherReports getPublisherReportsAdView(
@PathParam("loginId") String loginId,
@QueryParam("fromDate") String fromDate,
@QueryParam("toDate") String toDate,
@QueryParam("filterValue") String filterValue);