List of usage examples for org.springframework.http MediaType TEXT_XML_VALUE
String TEXT_XML_VALUE
To view the source code for org.springframework.http MediaType TEXT_XML_VALUE.
Click Source Link
From source file:com.eureka.v1_0.kyc.information.api.KycInformationApiController.java
@ResponseBody @RequestMapping(method = RequestMethod.POST, consumes = MediaType.TEXT_XML_VALUE, produces = MediaType.TEXT_XML_VALUE, value = "/removeemailinformation") public RemoveEmailInformationResponse removeEmailInformation( @RequestBody RemoveEmailInformationRequest removeEmailInformationRequest, HttpServletResponse response, HttpServletRequest request) {//from w w w . j a v a 2s . co m if (removeEmailInformationRequest != null) { try { RemoveEmailInformationResponse removeEmailInformationResponse = this.kycInformationApiService .removeEmailInformation(removeEmailInformationRequest); if (removeEmailInformationResponse != null) { witLoggerService.debug(JaxbHandler.toXml(removeEmailInformationResponse)); response.setStatus(HttpServletResponse.SC_OK); return removeEmailInformationResponse; } else { response.setStatus(HttpServletResponse.SC_EXPECTATION_FAILED); } } catch (Exception ex) { witLoggerService.warn(ex); response.setStatus(HttpServletResponse.SC_INTERNAL_SERVER_ERROR); } } response.setStatus(HttpServletResponse.SC_BAD_REQUEST); return null; }
From source file:com.eureka.v1_0.kyc.information.api.KycInformationApiController.java
@ResponseBody @RequestMapping(method = RequestMethod.POST, consumes = MediaType.TEXT_XML_VALUE, produces = MediaType.TEXT_XML_VALUE, value = "/updateemailinformation") public UpdateEmailInformationResponse updateEmailInformation( @RequestBody UpdateEmailInformationRequest updateEmailInformationRequest, HttpServletResponse response, HttpServletRequest request) {/*www . ja v a 2s . c o m*/ if (updateEmailInformationRequest != null) { try { UpdateEmailInformationResponse updateEmailInformationResponse = this.kycInformationApiService .updateEmailInformation(updateEmailInformationRequest); if (updateEmailInformationResponse != null) { witLoggerService.debug(JaxbHandler.toXml(updateEmailInformationResponse)); response.setStatus(HttpServletResponse.SC_OK); return updateEmailInformationResponse; } else { response.setStatus(HttpServletResponse.SC_EXPECTATION_FAILED); } } catch (Exception ex) { witLoggerService.warn(ex); response.setStatus(HttpServletResponse.SC_INTERNAL_SERVER_ERROR); } } response.setStatus(HttpServletResponse.SC_BAD_REQUEST); return null; }
From source file:com.eureka.v1_0.kyc.information.api.KycInformationApiController.java
@ResponseBody @RequestMapping(method = RequestMethod.POST, consumes = MediaType.TEXT_XML_VALUE, produces = MediaType.TEXT_XML_VALUE, value = "/validateemailinformation") public ValidateEmailInformationResponse validateEmailInformation( @RequestBody ValidateEmailInformationRequest validateEmailInformationRequest, HttpServletResponse response, HttpServletRequest request) { if (validateEmailInformationRequest != null) { try {//w ww.j a v a 2 s .co m ValidateEmailInformationResponse validateEmailInformationResponse = this.kycInformationApiService .validateEmailInformation(validateEmailInformationRequest); if (validateEmailInformationResponse != null) { witLoggerService.debug(JaxbHandler.toXml(validateEmailInformationResponse)); response.setStatus(HttpServletResponse.SC_OK); return validateEmailInformationResponse; } else { response.setStatus(HttpServletResponse.SC_EXPECTATION_FAILED); } } catch (Exception ex) { witLoggerService.warn(ex); response.setStatus(HttpServletResponse.SC_INTERNAL_SERVER_ERROR); } } response.setStatus(HttpServletResponse.SC_BAD_REQUEST); return null; }
From source file:com.eureka.v1_0.kyc.information.api.KycInformationApiController.java
@ResponseBody @RequestMapping(method = RequestMethod.POST, consumes = MediaType.TEXT_XML_VALUE, produces = MediaType.TEXT_XML_VALUE, value = "/createcontactinformation") public CreateContactInformationResponse createContactInformation( @RequestBody CreateContactInformationRequest createContactInformationRequest, HttpServletRequest request, HttpServletResponse response) { if (createContactInformationRequest != null) { try {// w w w .j av a 2 s. c om witLoggerService.debug(JaxbHandler.toXml(createContactInformationRequest)); CreateContactInformationResponse createContactInformationResponse = this.kycInformationApiService .createContactInformation(createContactInformationRequest); if (createContactInformationResponse != null) { witLoggerService.debug(JaxbHandler.toXml(createContactInformationResponse)); response.setStatus(HttpServletResponse.SC_OK); return createContactInformationResponse; } else { response.setStatus(HttpServletResponse.SC_EXPECTATION_FAILED); } } catch (Exception ex) { witLoggerService.warn(ex); response.setStatus(HttpServletResponse.SC_INTERNAL_SERVER_ERROR); } } response.setStatus(HttpServletResponse.SC_BAD_REQUEST); return null; }
From source file:com.eureka.v1_0.kyc.information.api.KycInformationApiController.java
@ResponseBody @RequestMapping(method = RequestMethod.POST, consumes = MediaType.TEXT_XML_VALUE, produces = MediaType.TEXT_XML_VALUE, value = "/findcontactinformation") public FindContactInformationResponse findContactInformation( @RequestBody FindContactInformationRequest findContactInformationRequest, HttpServletRequest request, HttpServletResponse response) {//from w ww . j av a 2 s . c o m if (findContactInformationRequest != null) { try { witLoggerService.debug(JaxbHandler.toXml(findContactInformationRequest)); FindContactInformationResponse findContactInformationResponse = this.kycInformationApiService .findContactInformation(findContactInformationRequest); if (findContactInformationResponse != null) { witLoggerService.debug(JaxbHandler.toXml(findContactInformationResponse)); response.setStatus(HttpServletResponse.SC_OK); return findContactInformationResponse; } else { response.setStatus(HttpServletResponse.SC_EXPECTATION_FAILED); } } catch (Exception ex) { witLoggerService.warn(ex); response.setStatus(HttpServletResponse.SC_INTERNAL_SERVER_ERROR); } } response.setStatus(HttpServletResponse.SC_BAD_REQUEST); return null; }
From source file:com.eureka.v1_0.kyc.information.api.KycInformationApiController.java
@ResponseBody @RequestMapping(method = RequestMethod.POST, consumes = MediaType.TEXT_XML_VALUE, produces = MediaType.TEXT_XML_VALUE, value = "/getcontactinformation") public GetContactInformationResponse getContactInformation( GetContactInformationRequest getContactInformationRequest, HttpServletRequest request, HttpServletResponse response) {/* ww w. j a v a 2s .c o m*/ if (getContactInformationRequest != null) { try { witLoggerService.debug(JaxbHandler.toXml(getContactInformationRequest)); GetContactInformationResponse getContactInformationResponse = this.kycInformationApiService .getContactInformation(getContactInformationRequest); if (getContactInformationResponse != null) { witLoggerService.debug(JaxbHandler.toXml(getContactInformationResponse)); response.setStatus(HttpServletResponse.SC_OK); return getContactInformationResponse; } else { response.setStatus(HttpServletResponse.SC_EXPECTATION_FAILED); } } catch (Exception ex) { witLoggerService.warn(ex); response.setStatus(HttpServletResponse.SC_INTERNAL_SERVER_ERROR); } } response.setStatus(HttpServletResponse.SC_BAD_REQUEST); return null; }
From source file:com.eureka.v1_0.kyc.information.api.KycInformationApiController.java
@ResponseBody @RequestMapping(method = RequestMethod.POST, consumes = MediaType.TEXT_XML_VALUE, produces = MediaType.TEXT_XML_VALUE, value = "/removecontactinformation") public RemoveContactInformationResponse removeContactInformation( RemoveContactInformationRequest removeContactInformationRequest, HttpServletRequest request, HttpServletResponse response) {/* www . j a v a2 s . c o m*/ if (removeContactInformationRequest != null) { try { witLoggerService.debug(JaxbHandler.toXml(removeContactInformationRequest)); RemoveContactInformationResponse removeContactInformationResponse = this.kycInformationApiService .removeContactInformation(removeContactInformationRequest); if (removeContactInformationResponse != null) { witLoggerService.debug(JaxbHandler.toXml(removeContactInformationResponse)); response.setStatus(HttpServletResponse.SC_OK); return removeContactInformationResponse; } else { response.setStatus(HttpServletResponse.SC_EXPECTATION_FAILED); } } catch (Exception ex) { witLoggerService.warn(ex); response.setStatus(HttpServletResponse.SC_INTERNAL_SERVER_ERROR); } } response.setStatus(HttpServletResponse.SC_BAD_REQUEST); return null; }
From source file:com.eureka.v1_0.kyc.information.api.KycInformationApiController.java
@ResponseBody @RequestMapping(method = RequestMethod.POST, consumes = MediaType.TEXT_XML_VALUE, produces = MediaType.TEXT_XML_VALUE, value = "/updatecontactinformation") public UpdateContactInformationResponse updateContactInformation( UpdateContactInformationRequest updateContactInformationRequest, HttpServletRequest request, HttpServletResponse response) {//from w ww. j av a2s. co m if (updateContactInformationRequest != null) { try { witLoggerService.debug(updateContactInformationRequest); UpdateContactInformationResponse updateContactInformationResponse = this.kycInformationApiService .updateContactInformation(updateContactInformationRequest); if (updateContactInformationResponse != null) { witLoggerService.debug(JaxbHandler.toXml(updateContactInformationResponse)); response.setStatus(HttpServletResponse.SC_OK); return updateContactInformationResponse; } else { response.setStatus(HttpServletResponse.SC_EXPECTATION_FAILED); } } catch (Exception ex) { witLoggerService.warn(ex); response.setStatus(HttpServletResponse.SC_INTERNAL_SERVER_ERROR); } } response.setStatus(HttpServletResponse.SC_BAD_REQUEST); return null; }
From source file:de.codecentric.boot.admin.server.web.client.InstanceWebClientTest.java
@Test public void should_not_add_default_accept_headers() { Instance instance = Instance.create(InstanceId.of("id")) .register(Registration.create("test", wireMock.url("/status")).build()); wireMock.stubFor(get("/status").willReturn(ok())); Mono<ClientResponse> exchange = instanceWebClient.instance(instance).get().uri("health") .header(ACCEPT, MediaType.TEXT_XML_VALUE).exchange(); StepVerifier.create(exchange).expectNextCount(1).verifyComplete(); wireMock.verify(1,/* w w w.j a v a 2 s . co m*/ getRequestedFor(urlEqualTo("/status")).withHeader(ACCEPT, equalTo(MediaType.TEXT_XML_VALUE))); }
From source file:org.fao.geonet.api.registries.vocabularies.KeywordsApi.java
/** * Gets the thesaurus./*from w ww .jav a 2 s .c o m*/ * * @param thesaurus the thesaurus * @param request the request * @param response the response * @return the thesaurus * @throws Exception the exception */ @ApiOperation(value = "Download a thesaurus by name", nickname = "getThesaurus", notes = "Download the thesaurus in SKOS format.") @RequestMapping(value = "/{thesaurus:.+}", method = RequestMethod.GET, produces = { MediaType.TEXT_XML_VALUE }) @ApiResponses(value = { @ApiResponse(code = 200, message = "Thesaurus in SKOS format."), @ApiResponse(code = 404, message = ApiParams.API_RESPONSE_RESOURCE_NOT_FOUND) }) @ResponseBody @ResponseStatus(HttpStatus.OK) public void getThesaurus( @ApiParam(value = "Thesaurus to download.", required = true) @PathVariable(value = "thesaurus") String thesaurus, HttpServletRequest request, HttpServletResponse response) throws Exception { ServiceContext context = ApiUtils.createServiceContext(request); GeonetContext gc = (GeonetContext) context.getHandlerContext(Geonet.CONTEXT_NAME); ThesaurusManager manager = gc.getBean(ThesaurusManager.class); Thesaurus directory = manager.getThesaurusByName(thesaurus); if (directory == null) throw new IllegalArgumentException("Thesaurus not found --> " + thesaurus); Path directoryFile = directory.getFile(); if (!Files.exists(directoryFile)) throw new IllegalArgumentException("Thesaurus file not found --> " + thesaurus); response.setContentType("text/xml"); response.setHeader("Content-Disposition", "attachment;filename=" + directoryFile.getFileName()); ServletOutputStream out = response.getOutputStream(); BufferedReader reader1 = new BufferedReader( new InputStreamReader(new FileInputStream(directoryFile.toFile()), Charset.forName("UTF-8"))); IOUtils.copy(reader1, out); out.flush(); out.close(); }