use of org.apache.olingo.commons.api.edmx.EdmxReference in project cxf by apache.
the class JaxrsODataService method service.
@GET
@Path("{id:.*}")
public Response service(@Context HttpServletRequest req, @Context HttpServletResponse resp) {
String requestMapping = req.getContextPath() + req.getServletPath() + "/DemoService.svc";
req.setAttribute("requestMapping", requestMapping);
// create odata handler and configure it with EdmProvider and Processor
OData odata = OData.newInstance();
ServiceMetadata edm = odata.createServiceMetadata(new DemoEdmProvider(), new ArrayList<EdmxReference>());
ODataHttpHandler handler = odata.createHandler(edm);
handler.register(new DemoEntityCollectionProcessor());
// let the handler do the work
handler.process(req, resp);
return Response.ok().build();
}
Aggregations