Example usage for javax.servlet.http HttpServletResponse SC_EXPECTATION_FAILED

List of usage examples for javax.servlet.http HttpServletResponse SC_EXPECTATION_FAILED

Introduction

In this page you can find the example usage for javax.servlet.http HttpServletResponse SC_EXPECTATION_FAILED.

Prototype

int SC_EXPECTATION_FAILED

To view the source code for javax.servlet.http HttpServletResponse SC_EXPECTATION_FAILED.

Click Source Link

Document

Status code (417) indicating that the server could not meet the expectation given in the Expect request header.

Usage

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 = "/updatemsisdninformation")
public UpdateMsisdnInformationResponse updateMsisdnInformation(
        @RequestBody UpdateMsisdnInformationRequest updateMsisdnInformationRequest,
        HttpServletResponse response, HttpServletRequest request) {
    if (updateMsisdnInformationRequest != null) {
        try {/*from  w  w w  . j  a v a  2s .  c  o  m*/
            UpdateMsisdnInformationResponse updateMsisdnInformationResponse = this.kycInformationApiService
                    .updateMsisdnInformation(updateMsisdnInformationRequest);
            if (updateMsisdnInformationResponse != null) {
                witLoggerService.debug(JaxbHandler.toXml(updateMsisdnInformationResponse));
                response.setStatus(HttpServletResponse.SC_OK);
                return updateMsisdnInformationResponse;
            } 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 = "/validatemsisdninformation")
public ValidateMsisdnInformationResponse validateMsisdnInformation(
        @RequestBody ValidateMsisdnInformationRequest validateMsisdnInformationRequest,
        HttpServletResponse response, HttpServletRequest request) {
    if (validateMsisdnInformationRequest != null) {
        try {/*from  ww  w  . j a  v a 2  s.com*/
            ValidateMsisdnInformationResponse validateMsisdnInformationResponse = this.kycInformationApiService
                    .validateMsisdnInformation(validateMsisdnInformationRequest);
            if (validateMsisdnInformationResponse != null) {
                witLoggerService.debug(JaxbHandler.toXml(validateMsisdnInformationResponse));
                response.setStatus(HttpServletResponse.SC_OK);
                return validateMsisdnInformationResponse;
            } 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 = "/createemailinformation")
public CreateEmailInformationResponse createEmailInformation(
        @RequestBody CreateEmailInformationRequest createEmailInformationRequest, HttpServletResponse response,
        HttpServletRequest request) {// w w w . j av a 2 s  . c  o m
    if (createEmailInformationRequest != null) {
        try {
            CreateEmailInformationResponse createEmailInformationResponse = this.kycInformationApiService
                    .createEmailInformation(createEmailInformationRequest);
            if (createEmailInformationResponse != null) {
                witLoggerService.debug(JaxbHandler.toXml(createEmailInformationResponse));
                response.setStatus(HttpServletResponse.SC_OK);
                return createEmailInformationResponse;
            } 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 = "/findaccountemailinformation")
public FindAccountEmailInformationResponse findAccountEmailInformation(
        @RequestBody FindAccountEmailInformationRequest findAccountEmailInformationRequest,
        HttpServletResponse response, HttpServletRequest request) {
    if (findAccountEmailInformationRequest != null) {
        try {//from  www .  j ava 2 s.  c  o  m
            FindAccountEmailInformationResponse findAccountEmailInformationResponse = this.kycInformationApiService
                    .findAccountEmailInformation(findAccountEmailInformationRequest);
            if (findAccountEmailInformationResponse != null) {
                witLoggerService.debug(JaxbHandler.toXml(findAccountEmailInformationResponse));
                response.setStatus(HttpServletResponse.SC_OK);
                return findAccountEmailInformationResponse;
            } 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 = "/removeemailinformation")
public RemoveEmailInformationResponse removeEmailInformation(
        @RequestBody RemoveEmailInformationRequest removeEmailInformationRequest, HttpServletResponse response,
        HttpServletRequest request) {//from  ww  w  .j a  v a  2 s. 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.  j a  v a2s .  com
    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 {/*from   ww  w  . jav  a  2s.  c  o 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 {/*from   w  w  w . j  a va2  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 w  w .j  a  va  2s  .  co 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) {/* w  w  w  .  j  a v  a2  s. 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;
}