public async Task <IActionResult> OONVehicleLookup([FromBody] OONVehicleLookupInput request) { try { //string incomingText = this.Request.ToString.ReadAsStringAsync().Result; //XElement incomingXml = XElement.Parse(incomingText); if (!Validate(request)) { return(BadRequest("Invalid input data received. Verify input request data.")); } var xmlOutput = await _falconPort.SubmitFalconRequest(_aspPage, request); return(StatusCode(StatusCodes.Status201Created, xmlOutput)); } catch (HttpStatusException ex) { return(StatusCode((int)ex.StatusCode, ex.Message)); } catch (Exception ex) { return(StatusCode(StatusCodes.Status500InternalServerError, $"Processing error [{ ex }] received for { this.GetMethodName() } request [{ request.ToXml("Request") }]. Verify input request data.")); } }
bool Validate(OONVehicleLookupInput request) { return(request != null); }