Пример #1
0
        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."));
            }
        }
Пример #2
0
 bool Validate(OONVehicleLookupInput request)
 {
     return(request != null);
 }