In template, put "Response" instead of "javax.ws.rs.core.Response".