예제 #1
0
        /// <summary>Unconfirmed</summary>
        public NRA_ABIS_Envelope.Response Delete_Record(NRA_ABIS_Envelope.Request request)
        {
            DateTime request_date_time = DateTime.Now;

            NRA_ABIS_Envelope.EnvelopeType envelope_type = NRA_ABIS_Envelope.EnvelopeType.Delete_Record;

            NRA_ABIS_Envelope.Response response = null;

            try
            {
                //validate request

                response = Validate.Request(request, envelope_type, request_date_time, true, false, false, true, true, false, false);

                if (response != null)
                {
                    return(response);
                }



                ////validate request

                //if (request == null)
                //{
                //    return new NRA_ABIS_Envelope.Response() { Footer = Request_Exceptions.Set_Exception(envelope_type, Exception_Type.no_request_object) };
                //}

                ////validate header

                //if (request.Header == null)
                //{
                //    return new NRA_ABIS_Envelope.Response() { Footer = Request_Exceptions.Set_Exception(envelope_type, Exception_Type.no_header_object) };
                //}

                //if (request.Header.RequestType == null
                //    ||
                //    request.Header.RequestType != envelope_type)
                //{
                //    return new NRA_ABIS_Envelope.Response() { Footer = Request_Exceptions.Set_Exception(envelope_type, Exception_Type.no_request_type) };
                //}



                //return new GenericResponse() { ResponseCode = 1001, ResponseMessage = "Deletion Successful", ResponseObject = null };
            }

            catch (Exception ex)
            {
                //cslog.Handle_Exception(ex);
            }

            return(response);
        }
예제 #2
0
        /// <summary>Validate a requets envelope</summary>
        internal static NRA_ABIS_Envelope.Response Request(NRA_ABIS_Envelope.Request request, NRA_ABIS_Envelope.EnvelopeType envelope_type, DateTime request_date_time
                                                           , bool header_cprid, bool header_guid, bool header_reference_uid
                                                           , bool detail_fingerprint, bool detail_portrait, bool detail_signature, bool detail_template)
        {
            try
            {
                //---------------------------------------------------------------------------------

                //validate the request object

                if (request == null)
                {
                    return(new NRA_ABIS_Envelope.Response()
                    {
                        Footer = Request_Exceptions.Set_Exception(envelope_type, request_date_time, Exception_Type.no_request_object)
                    });
                }

                //---------------------------------------------------------------------------------

                //validate the request header

                if (request.Header == null)
                {
                    return(new NRA_ABIS_Envelope.Response()
                    {
                        Footer = Request_Exceptions.Set_Exception(envelope_type, request_date_time, Exception_Type.no_header_object)
                    });
                }

                if (header_cprid
                    &&
                    request.Header.CPRID == null)
                {
                    return(new NRA_ABIS_Envelope.Response()
                    {
                        Footer = Request_Exceptions.Set_Exception(envelope_type, request_date_time, Exception_Type.no_cpr_id)
                    });
                }

                if (header_guid
                    &&
                    request.Header.Guid == null)
                {
                    return(new NRA_ABIS_Envelope.Response()
                    {
                        Footer = Request_Exceptions.Set_Exception(envelope_type, request_date_time, Exception_Type.no_guid)
                    });
                }

                if (header_reference_uid
                    &&
                    string.IsNullOrEmpty(request.Header.ReferenceUID))
                {
                    return(new NRA_ABIS_Envelope.Response()
                    {
                        Footer = Request_Exceptions.Set_Exception(envelope_type, request_date_time, Exception_Type.no_reference_uid)
                    });
                }

                if (request.Header.RequestType == null)
                {
                    return(new NRA_ABIS_Envelope.Response()
                    {
                        Footer = Request_Exceptions.Set_Exception(envelope_type, request_date_time, Exception_Type.no_request_type)
                    });
                }

                if (request.Header.RequestType != envelope_type)
                {
                    return(new NRA_ABIS_Envelope.Response()
                    {
                        Footer = Request_Exceptions.Set_Exception(envelope_type, request_date_time, Exception_Type.invalid_request_type)
                    });
                }

                //---------------------------------------------------------------------------------

                //validate request detail

                if (request.Detail == null)
                {
                    return(new NRA_ABIS_Envelope.Response()
                    {
                        Footer = Request_Exceptions.Set_Exception(envelope_type, request_date_time, Exception_Type.no_detail_object)
                    });
                }

                //---------------------------------------------------------------------------------

                //validate request detail fingerprint

                if (detail_fingerprint)
                {
                    if (request.Detail.Fingerprint == null)
                    {
                        return(new NRA_ABIS_Envelope.Response()
                        {
                            Footer = Request_Exceptions.Set_Exception(envelope_type, request_date_time, Exception_Type.no_fingerprint_object)
                        });
                    }

                    if (request.Detail.Fingerprint.Count < 1)
                    {
                        return(new NRA_ABIS_Envelope.Response()
                        {
                            Footer = Request_Exceptions.Set_Exception(envelope_type, request_date_time, Exception_Type.no_fingerprint_data)
                        });
                    }

                    for (int i = 0; i < request.Detail.Fingerprint.Count; i++)
                    {
                        if (request.Detail.Fingerprint[i].Status == null)
                        {
                            return(new NRA_ABIS_Envelope.Response()
                            {
                                Footer = Request_Exceptions.Set_Exception(envelope_type, request_date_time, Exception_Type.no_fingerprint_status, i)
                            });
                        }

                        if (request.Detail.Fingerprint[i].ImageData == null)
                        {
                            return(new NRA_ABIS_Envelope.Response()
                            {
                                Footer = Request_Exceptions.Set_Exception(envelope_type, request_date_time, Exception_Type.no_fingerprint_image_data, i)
                            });
                        }

                        if (request.Detail.Fingerprint[i].ImageData.Length < min_fingerprint_image_data_length)
                        {
                            return(new NRA_ABIS_Envelope.Response()
                            {
                                Footer = Request_Exceptions.Set_Exception(envelope_type, request_date_time, Exception_Type.invalid_fingerprint_image_data_length, i)
                            });
                        }

                        if (request.Detail.Fingerprint[i].ImageFormat == null)
                        {
                            return(new NRA_ABIS_Envelope.Response()
                            {
                                Footer = Request_Exceptions.Set_Exception(envelope_type, request_date_time, Exception_Type.no_fingerprint_image_format, i)
                            });
                        }

                        if (request.Detail.Fingerprint[i].Postion == null)
                        {
                            return(new NRA_ABIS_Envelope.Response()
                            {
                                Footer = Request_Exceptions.Set_Exception(envelope_type, request_date_time, Exception_Type.no_fingerprint_position, i)
                            });
                        }

                        if (request.Detail.Fingerprint[i].Quality == null)
                        {
                            return(new NRA_ABIS_Envelope.Response()
                            {
                                Footer = Request_Exceptions.Set_Exception(envelope_type, request_date_time, Exception_Type.no_fingerprint_quality, i)
                            });
                        }
                    }
                }

                //---------------------------------------------------------------------------------

                //validate request detail portrait

                if (detail_portrait)
                {
                    if (request.Detail.Portrait == null)
                    {
                        return(new NRA_ABIS_Envelope.Response()
                        {
                            Footer = Request_Exceptions.Set_Exception(envelope_type, request_date_time, Exception_Type.no_portrait_object)
                        });
                    }

                    if (request.Detail.Portrait.Count < 1)
                    {
                        return(new NRA_ABIS_Envelope.Response()
                        {
                            Footer = Request_Exceptions.Set_Exception(envelope_type, request_date_time, Exception_Type.no_portrait_data)
                        });
                    }

                    for (int i = 0; i < request.Detail.Portrait.Count; i++)
                    {
                        if (request.Detail.Portrait[i].ImageDataICAO == null
                            &&
                            request.Detail.Portrait[i].ImageDataOriginal == null)
                        {
                            return(new NRA_ABIS_Envelope.Response()
                            {
                                Footer = Request_Exceptions.Set_Exception(envelope_type, request_date_time, Exception_Type.no_portrait_image_data, i)
                            });
                        }

                        if (request.Detail.Portrait[i].ImageDataICAO != null
                            &&
                            request.Detail.Portrait[i].ImageDataOriginal != null)
                        {
                            return(new NRA_ABIS_Envelope.Response()
                            {
                                Footer = Request_Exceptions.Set_Exception(envelope_type, request_date_time, Exception_Type.double_portrait_image_data, i)
                            });
                        }

                        if (request.Detail.Portrait[i].ImageDataICAO == null)
                        {
                            if (request.Detail.Portrait[i].CropHeight == null)
                            {
                                return(new NRA_ABIS_Envelope.Response()
                                {
                                    Footer = Request_Exceptions.Set_Exception(envelope_type, request_date_time, Exception_Type.no_portrait_crop_height, i)
                                });
                            }

                            if (request.Detail.Portrait[i].CropLeft == null)
                            {
                                return(new NRA_ABIS_Envelope.Response()
                                {
                                    Footer = Request_Exceptions.Set_Exception(envelope_type, request_date_time, Exception_Type.no_portrait_crop_left, i)
                                });
                            }

                            if (request.Detail.Portrait[i].CropTop == null)
                            {
                                return(new NRA_ABIS_Envelope.Response()
                                {
                                    Footer = Request_Exceptions.Set_Exception(envelope_type, request_date_time, Exception_Type.no_portrait_crop_top, i)
                                });
                            }

                            if (request.Detail.Portrait[i].CropWidth == null)
                            {
                                return(new NRA_ABIS_Envelope.Response()
                                {
                                    Footer = Request_Exceptions.Set_Exception(envelope_type, request_date_time, Exception_Type.no_portrait_crop_width, i)
                                });
                            }

                            if (request.Detail.Portrait[i].ImageDataOriginal == null)
                            {
                                return(new NRA_ABIS_Envelope.Response()
                                {
                                    Footer = Request_Exceptions.Set_Exception(envelope_type, request_date_time, Exception_Type.no_portrait_image_data_original, i)
                                });
                            }

                            if (request.Detail.Portrait[i].ImageDataOriginal.Length < min_portrait_image_data_original_length)
                            {
                                return(new NRA_ABIS_Envelope.Response()
                                {
                                    Footer = Request_Exceptions.Set_Exception(envelope_type, request_date_time, Exception_Type.invalid_portrait_image_data_original_length, i)
                                });
                            }

                            if (request.Detail.Portrait[i].ImageFormat == null)
                            {
                                return(new NRA_ABIS_Envelope.Response()
                                {
                                    Footer = Request_Exceptions.Set_Exception(envelope_type, request_date_time, Exception_Type.no_portrait_image_format, i)
                                });
                            }
                        }

                        if (request.Detail.Portrait[i].ImageDataOriginal == null)
                        {
                            if (request.Detail.Portrait[i].ImageDataICAO == null)
                            {
                                return(new NRA_ABIS_Envelope.Response()
                                {
                                    Footer = Request_Exceptions.Set_Exception(envelope_type, request_date_time, Exception_Type.no_portrait_image_data_icao, i)
                                });
                            }

                            if (request.Detail.Portrait[i].ImageDataICAO.Length < min_portrait_image_data_icao_length)
                            {
                                return(new NRA_ABIS_Envelope.Response()
                                {
                                    Footer = Request_Exceptions.Set_Exception(envelope_type, request_date_time, Exception_Type.invalid_portrait_image_data_icao_length, i)
                                });
                            }
                        }
                    }
                }

                //---------------------------------------------------------------------------------

                //validate request detail signature

                if (detail_signature)
                {
                    if (request.Detail.Signature == null)
                    {
                        return(new NRA_ABIS_Envelope.Response()
                        {
                            Footer = Request_Exceptions.Set_Exception(envelope_type, request_date_time, Exception_Type.no_signature_object)
                        });
                    }

                    if (request.Detail.Signature.Count < 1)
                    {
                        return(new NRA_ABIS_Envelope.Response()
                        {
                            Footer = Request_Exceptions.Set_Exception(envelope_type, request_date_time, Exception_Type.no_signature_data)
                        });
                    }

                    for (int i = 0; i < request.Detail.Signature.Count; i++)
                    {
                        if (request.Detail.Signature[i].ImageData == null)
                        {
                            return(new NRA_ABIS_Envelope.Response()
                            {
                                Footer = Request_Exceptions.Set_Exception(envelope_type, request_date_time, Exception_Type.no_signature_image_data, i)
                            });
                        }

                        if (request.Detail.Signature[i].ImageData.Length < min_signature_image_data_length)
                        {
                            return(new NRA_ABIS_Envelope.Response()
                            {
                                Footer = Request_Exceptions.Set_Exception(envelope_type, request_date_time, Exception_Type.invalid_signature_image_data_length, i)
                            });
                        }

                        if (request.Detail.Signature[i].ImageFormat == null)
                        {
                            return(new NRA_ABIS_Envelope.Response()
                            {
                                Footer = Request_Exceptions.Set_Exception(envelope_type, request_date_time, Exception_Type.no_signature_image_format, i)
                            });
                        }
                    }
                }

                //---------------------------------------------------------------------------------

                //validate request detail template

                if (detail_template)
                {
                    if (request.Detail.Template == null)
                    {
                        return(new NRA_ABIS_Envelope.Response()
                        {
                            Footer = Request_Exceptions.Set_Exception(envelope_type, request_date_time, Exception_Type.no_template_object)
                        });
                    }

                    if (request.Detail.Template.Count < 1)
                    {
                        return(new NRA_ABIS_Envelope.Response()
                        {
                            Footer = Request_Exceptions.Set_Exception(envelope_type, request_date_time, Exception_Type.no_template_data)
                        });
                    }

                    for (int i = 0; i < request.Detail.Template.Count; i++)
                    {
                        if (request.Detail.Template[i].Template == null)
                        {
                            return(new NRA_ABIS_Envelope.Response()
                            {
                                Footer = Request_Exceptions.Set_Exception(envelope_type, request_date_time, Exception_Type.no_template_image_data, i)
                            });
                        }

                        if (request.Detail.Template[i].Template.Length < min_template_data_length)
                        {
                            return(new NRA_ABIS_Envelope.Response()
                            {
                                Footer = Request_Exceptions.Set_Exception(envelope_type, request_date_time, Exception_Type.invalid_template_data_length, i)
                            });
                        }

                        if (request.Detail.Template[i].TemplateFormat == null)
                        {
                            return(new NRA_ABIS_Envelope.Response()
                            {
                                Footer = Request_Exceptions.Set_Exception(envelope_type, request_date_time, Exception_Type.no_template_format, i)
                            });
                        }
                    }
                }

                //---------------------------------------------------------------------------------
            }

            catch (Exception ex)
            {
            }

            return(null);
        }
        /// <summary></summary>
        internal static NRA_ABIS_Envelope.Response._Footer Set_Exception(NRA_ABIS_Envelope.EnvelopeType envelope_type, DateTime request_date_time, Exception_Type exception_type, int data_index = 0)
        {
            int?log_code = 0000;

            string log_source = envelope_type.ToString();

            string log_message = string.Empty;

            bool log_status = false;

            NRA_ABIS_Envelope.Response._Footer footer = null;

            try
            {
                switch (exception_type)
                {
                case Exception_Type.success:

                    log_code = 1001;

                    log_message = "success";

                    log_status = true;

                    break;

                case Exception_Type.no_request_object:

                    log_code = 1002;

                    log_message = "no request object";

                    break;

                case Exception_Type.no_header_object:

                    log_code = 1003;

                    log_message = "no header object in request";

                    break;

                case Exception_Type.no_cpr_id:

                    log_code = 1004;

                    log_message = "no cprid in request header";

                    break;

                case Exception_Type.no_guid:

                    log_code = 1005;

                    log_message = "no guid in request header";

                    break;

                case Exception_Type.no_reference_uid:

                    log_code = 1006;

                    log_message = "no reference uid in request header";

                    break;

                case Exception_Type.no_request_type:

                    log_code = 1007;

                    log_message = "no request type in request header";

                    break;

                case Exception_Type.invalid_request_type:

                    log_code = 1008;

                    log_message = "invalid request type in request header";

                    break;

                case Exception_Type.no_detail_object:

                    log_code = 1009;

                    log_message = "no detail object in request";

                    break;

                case Exception_Type.no_fingerprint_object:

                    log_code = 1010;

                    log_message = "no fingerprint object in request";

                    break;

                case Exception_Type.no_fingerprint_data:

                    log_code = 1011;

                    log_message = "no fingerprint data in request";

                    break;

                case Exception_Type.no_fingerprint_status:

                    log_code = 1012;

                    log_message = "no fingerprint status on index " + data_index.ToString() + " in request";

                    break;

                case Exception_Type.no_fingerprint_image_data:

                    log_code = 1013;

                    log_message = "no fingerprint image data on index " + data_index.ToString() + " in request";

                    break;

                case Exception_Type.invalid_fingerprint_image_data_length:

                    log_code = 1014;

                    log_message = "invalid fingerprint image data on index " + data_index.ToString() + " in request";

                    break;

                case Exception_Type.no_fingerprint_image_format:

                    log_code = 1015;

                    log_message = "no fingerprint image format on index " + data_index.ToString() + " in request";

                    break;

                case Exception_Type.no_fingerprint_position:

                    log_code = 1016;

                    log_message = "no fingerprint position on index " + data_index.ToString() + " in request";

                    break;

                case Exception_Type.no_fingerprint_quality:

                    log_code = 1017;

                    log_message = "no fingerprint quality on index " + data_index.ToString() + " in request";

                    break;

                case Exception_Type.no_portrait_object:

                    log_code = 1018;

                    log_message = "no portrait object in request";

                    break;

                case Exception_Type.no_portrait_data:

                    log_code = 1019;

                    log_message = "no portrait data in request";

                    break;

                case Exception_Type.no_portrait_image_data:

                    log_code = 1020;

                    log_message = "no portrait image data on index " + data_index.ToString() + " in request";

                    break;

                case Exception_Type.double_portrait_image_data:

                    log_code = 1021;

                    log_message = "double portrait image data on index " + data_index.ToString() + " in request";

                    break;

                case Exception_Type.no_portrait_crop_height:

                    log_code = 1022;

                    log_message = "no portrait crop height on index " + data_index.ToString() + " in request";

                    break;

                case Exception_Type.no_portrait_crop_left:

                    log_code = 1023;

                    log_message = "no portrait crop left on index " + data_index.ToString() + " in request";

                    break;

                case Exception_Type.no_portrait_crop_top:

                    log_code = 1024;

                    log_message = "no portrait crop top on index " + data_index.ToString() + " in request";

                    break;

                case Exception_Type.no_portrait_crop_width:

                    log_code = 1025;

                    log_message = "no portrait crop width on index " + data_index.ToString() + " in request";

                    break;

                case Exception_Type.no_portrait_image_data_original:

                    log_code = 1026;

                    log_message = "no original portrait image data on index " + data_index.ToString() + " in request";

                    break;

                case Exception_Type.invalid_portrait_image_data_original_length:

                    log_code = 1027;

                    log_message = "invalid original portrait image data on index " + data_index.ToString() + " in request";

                    break;

                case Exception_Type.no_portrait_image_format:

                    log_code = 1028;

                    log_message = "no portrait image format on index " + data_index.ToString() + " in request";

                    break;

                case Exception_Type.no_portrait_image_data_icao:

                    log_code = 1029;

                    log_message = "no portrait image icao data on index " + data_index.ToString() + " in request";

                    break;

                case Exception_Type.invalid_portrait_image_data_icao_length:

                    log_code = 1030;

                    log_message = "invalid icao portrait image data on index " + data_index.ToString() + " in request";

                    break;

                case Exception_Type.no_signature_object:

                    log_code = 1031;

                    log_message = "no signature object in request";

                    break;

                case Exception_Type.no_signature_data:

                    log_code = 1032;

                    log_message = "no signature data in request";

                    break;

                case Exception_Type.no_signature_image_data:

                    log_code = 1033;

                    log_message = "no signature image data on index " + data_index.ToString() + " in request";

                    break;

                case Exception_Type.invalid_signature_image_data_length:

                    log_code = 1034;

                    log_message = "invalid signature image data on index " + data_index.ToString() + " in request";

                    break;

                case Exception_Type.no_signature_image_format:

                    log_code = 1035;

                    log_message = "no signature image format on index " + data_index.ToString() + " in request";

                    break;

                case Exception_Type.no_template_object:

                    log_code = 1036;

                    log_message = "no template object in request";

                    break;

                case Exception_Type.no_template_data:

                    log_code = 1037;

                    log_message = "no template data in request";

                    break;

                case Exception_Type.no_template_image_data:

                    log_code = 1038;

                    log_message = "no template data on index " + data_index.ToString() + " in request";

                    break;

                case Exception_Type.invalid_template_data_length:

                    log_code = 1039;

                    log_message = "invalid template data on index " + data_index.ToString() + " in request";

                    break;

                case Exception_Type.no_template_format:

                    log_code = 1040;

                    log_message = "no template format on index " + data_index.ToString() + " in request";

                    break;
                }

                //create the response footer

                footer = new NRA_ABIS_Envelope.Response._Footer()
                {
                    ResponseCode = log_code
                    ,
                    ResponseMessage = log_message
                    ,
                    ResponseType = envelope_type
                    ,
                    ResponseStatus = log_status
                };

                //write to log

                Write_To_Log(log_code, log_source, log_message, log_status);
            }

            catch (Exception ex)
            {
                footer = Set_Exception(envelope_type, ex);
            }

            //return

            return(footer);
        }
        /// <summary></summary>
        /// <param name="envelope_type"></param>
        /// <param name="exception"></param>
        internal static NRA_ABIS_Envelope.Response._Footer Set_Exception(NRA_ABIS_Envelope.EnvelopeType envelope_type, Exception exception)
        {
            int?log_code;

            string log_source = envelope_type.ToString();

            string log_message = string.Empty;

            NRA_ABIS_Envelope.Response._Footer footer = null;

            try
            {
                //set the parameters

                log_code = 1098;

                log_message = exception.Message.ToLower();

                //create the response footer

                footer = new NRA_ABIS_Envelope.Response._Footer()
                {
                    ResponseCode = log_code
                    ,
                    ResponseMessage = log_message
                    ,
                    ResponseType = envelope_type
                    ,
                    ResponseStatus = false
                };
            }

            catch (Exception ex)
            {
                //set the parameters

                log_code = 1099;

                log_message = ex.Message.ToLower();

                //create the response footer

                footer = new NRA_ABIS_Envelope.Response._Footer()
                {
                    ResponseCode = log_code
                    ,
                    ResponseMessage = log_message
                    ,
                    ResponseType = envelope_type
                    ,
                    ResponseStatus = false
                };
            }

            //write to log

            Write_To_Log(log_code, log_source, log_message, false);

            //return

            return(footer);
        }
예제 #5
0
        /// <summary>Asynchronuos</summary>
        public NRA_ABIS_Envelope.Response Portrait_Identification_Result(NRA_ABIS_Envelope.Request request)
        {
            DateTime request_date_time = DateTime.Now;

            NRA_ABIS_Envelope.EnvelopeType envelope_type = NRA_ABIS_Envelope.EnvelopeType.Portrait_Identification_Result;

            NRA_ABIS_Envelope.Response response = null;

            try
            {
                //validate request

                response = Validate.Request(request, envelope_type, request_date_time, true, false, false, true, true, false, false);

                if (response != null)
                {
                    return(response);
                }



                ////validate request

                //if (request == null)
                //{
                //    return new NRA_ABIS_Envelope.Response() { Footer = Request_Exceptions.Set_Exception(envelope_type, Exception_Type.no_request_object) };
                //}

                ////validate header

                //if (request.Header == null)
                //{
                //    return new NRA_ABIS_Envelope.Response() { Footer = Request_Exceptions.Set_Exception(envelope_type, Exception_Type.no_header_object) };
                //}

                //if (request.Header.RequestType == null
                //    ||
                //    request.Header.RequestType != envelope_type)
                //{
                //    return new NRA_ABIS_Envelope.Response() { Footer = Request_Exceptions.Set_Exception(envelope_type, Exception_Type.no_request_type) };
                //}

                //if (string.IsNullOrEmpty(request.Header.ReferenceUID))
                //{
                //    return new NRA_ABIS_Envelope.Response() { Footer = Request_Exceptions.Set_Exception(envelope_type, Exception_Type.no_reference_uid) };
                //}

                ////validate detail

                //if (request.Detail == null)
                //{
                //    return new NRA_ABIS_Envelope.Response() { Footer = Request_Exceptions.Set_Exception(envelope_type, Exception_Type.no_detail_object) };
                //}

                ////validate portrait data

                //if (request.Detail.Portrait == null)
                //{
                //    return new NRA_ABIS_Envelope.Response() { Footer = Request_Exceptions.Set_Exception(envelope_type, Exception_Type.no_portrait_object) };
                //}

                //if (request.Detail.Portrait.Count == 0)
                //{
                //    return new NRA_ABIS_Envelope.Response() { Footer = Request_Exceptions.Set_Exception(envelope_type, Exception_Type.no_portrait_data) };
                //}



                ////face identification reuslt

                //cslog.WriteToTransactionLog(string.Format("Log Source Server: {0}, {1}, Log Source: {2}, {3}, Log Message: {4}", Environment.MachineName, Environment.NewLine, "FaceIdentificationResult", Environment.NewLine, "Sending transaction with reference id " + faceIdentificationResultRequest.ReferenceUniqID + " for face identification"));



                //populate identification response

                //response = new IdentificationResponse()
                //{
                //    CPR_ID = long.Parse(DateTime.Now.ToString("yyMMddHHmmssfff"))
                //    ,
                //    ReferenceUniqID = faceIdentificationResultRequest.ReferenceUniqID
                //};
            }

            catch (Exception ex)
            {
                //response = new IdentificationResponse();

                //cslog.Handle_Exception(ex);
            }

            return(response);
        }
예제 #6
0
        /// <summary>Synchronous : Fingerprint verification service operation</summary>
        public NRA_ABIS_Envelope.Response Fingerprint_Verification(NRA_ABIS_Envelope.Request request)
        {
            DateTime request_date_time = DateTime.Now;

            NRA_ABIS_Envelope.EnvelopeType envelope_type = NRA_ABIS_Envelope.EnvelopeType.Fingerprint_Verification;

            NRA_ABIS_Envelope.Response response = null;

            try
            {
                //validate request

                response = Validate.Request(request, envelope_type, request_date_time, true, false, false, true, true, false, false);

                if (response != null)
                {
                    return(response);
                }



                ////validate request

                //if (request == null)
                //{
                //    return new NRA_ABIS_Envelope.Response() { Footer = Request_Exceptions.Set_Exception(envelope_type, Exception_Type.no_request_object) };
                //}

                ////validate header

                //if (request.Header == null)
                //{
                //    return new NRA_ABIS_Envelope.Response() { Footer = Request_Exceptions.Set_Exception(envelope_type, Exception_Type.no_header_object) };
                //}

                //if (request.Header.RequestType == null
                //    ||
                //    request.Header.RequestType != envelope_type)
                //{
                //    return new NRA_ABIS_Envelope.Response() { Footer = Request_Exceptions.Set_Exception(envelope_type, Exception_Type.no_request_type) };
                //}

                //if (request.Header.CPRID == null)
                //{
                //    return new NRA_ABIS_Envelope.Response() { Footer = Request_Exceptions.Set_Exception(envelope_type, Exception_Type.no_cpr_id) };
                //}

                ////validate detail

                //if (request.Detail == null)
                //{
                //    return new NRA_ABIS_Envelope.Response() { Footer = Request_Exceptions.Set_Exception(envelope_type, Exception_Type.no_detail_object) };
                //}

                ////validate fingerprint data

                //if (request.Detail.Fingerprint == null)
                //{
                //    return new NRA_ABIS_Envelope.Response() { Footer = Request_Exceptions.Set_Exception(envelope_type, Exception_Type.no_fingerprint_object) };
                //}

                //if (request.Detail.Fingerprint.Count == 0)
                //{
                //    return new NRA_ABIS_Envelope.Response() { Footer = Request_Exceptions.Set_Exception(envelope_type, Exception_Type.no_fingerprint_data) };
                //}



                //List<Fingerprint> FingerList = new List<Fingerprint>();
                //List<Fingerprint> TempFingerList = verificationRequest.biometricInfo.fingerprints.OfType<Fingerprint>().ToList();

                //if (TempFingerList.Count < 1)
                //{
                //    //response = new VerificationResponse();
                //    //genericResponse = new GenericResponse() { ResponseCode = 1007, ResponseMessage = "No fingerprints available for Verification", ResponseObject = (VerificationResponse)response };
                //    cslog.WriteToTransactionLog(string.Format("Log Source Server: {0}, {1}, Log Message: {2}", Environment.MachineName, Environment.NewLine, "No fingerprints available for Verification"));
                //    //return genericResponse;
                //}


                //foreach (Fingerprint fin in TempFingerList)
                //{
                //    if (fin != null)
                //    {
                //        if (fin.status != 0 && fin.wsqImage != null)
                //        {
                //            FingerList.Add(fin);
                //        }
                //    }
                //}

                //int FingerCounts = FingerList.Count;
                //cslog.WriteToTransactionLog(string.Format("Log Source Server: {0}, {1}, Log Message: {2}", Environment.MachineName, Environment.NewLine, FingerCounts + " detected available for verification"));

                //Call Matcher to match fingers



                //Populate VerificationResponse with match results

                //response = new VerificationResponse()
                //{
                //    ReferenceUniqID = Guid.NewGuid().ToString().ToUpper(),
                //    result = true
                //};
                //cslog.WriteToTransactionLog(string.Format("Log Source Server: {0}, {1}, Log Source: {2}, {3}, Log Message: {4}", Environment.MachineName, Environment.NewLine, "FingerprintIdentification", Environment.NewLine, "Sending Transaction with Reference ID: " + response.ReferenceUniqID + " For Fingerprint Identification"));


                //genericResponse = new GenericResponse() { ResponseCode = 1001, ResponseMessage = "Successful fingerprint identification", ResponseObject = (VerificationResponse)response };

                //return genericResponse;
            }
            catch (Exception ex)
            {
                //response = new VerificationResponse();
                //cslog.Handle_Exception(ex);
                //genericResponse = new GenericResponse() { ResponseCode = 1008, ResponseMessage = ex.Message.ToUpperInvariant(), ResponseObject = response };
                //return genericResponse;
            }

            return(response);
        }
예제 #7
0
        /// <summary>Synchronous : Generate template request for DCS server</summary>
        public NRA_ABIS_Envelope.Response Fingerprint_Template(NRA_ABIS_Envelope.Request request)
        {
            DateTime request_date_time = DateTime.Now;

            NRA_ABIS_Envelope.EnvelopeType envelope_type = NRA_ABIS_Envelope.EnvelopeType.Fingerprint_Template;

            NRA_ABIS_Envelope.Response response = null;

            try
            {
                //validate request

                response = Validate.Request(request, envelope_type, request_date_time, true, false, false, true, true, false, false);

                if (response != null)
                {
                    return(response);
                }



                ////validate request

                //if (request == null)
                //{
                //    return new NRA_ABIS_Envelope.Response() { Footer = Request_Exceptions.Set_Exception(envelope_type, Exception_Type.no_request_object) };
                //}

                ////validate header

                //if (request.Header == null)
                //{
                //    return new NRA_ABIS_Envelope.Response() { Footer = Request_Exceptions.Set_Exception(envelope_type, Exception_Type.no_header_object) };
                //}

                //if (request.Header.RequestType == null
                //    ||
                //    request.Header.RequestType != envelope_type)
                //{
                //    return new NRA_ABIS_Envelope.Response() { Footer = Request_Exceptions.Set_Exception(envelope_type, Exception_Type.no_request_type) };
                //}

                ////validate detail

                //if (request.Detail == null)
                //{
                //    return new NRA_ABIS_Envelope.Response() { Footer = Request_Exceptions.Set_Exception(envelope_type, Exception_Type.no_detail_object) };
                //}

                ////validate fingerprint data

                //if (request.Detail.Fingerprint == null)
                //{
                //    return new NRA_ABIS_Envelope.Response() { Footer = Request_Exceptions.Set_Exception(envelope_type, Exception_Type.no_fingerprint_object) };
                //}

                //if (request.Detail.Fingerprint.Count == 0)
                //{
                //    return new NRA_ABIS_Envelope.Response() { Footer = Request_Exceptions.Set_Exception(envelope_type, Exception_Type.no_fingerprint_data) };
                //}



                //List<Fingerprint> FingerList = new List<Fingerprint>();
                //List<Fingerprint> TempFingerList = fingerprint.OfType<Fingerprint>().ToList();

                //if (TempFingerList.Count < 1)
                //{
                //    //response = new ISOFingerprintTemplates();
                //    genericResponse = new GenericResponse() { ResponseCode = 1004, ResponseMessage = "No Fingerprint Images Available", ResponseObject = response };
                //    cslog.WriteToTransactionLog(string.Format("Log Source Server: {0}, {1}, Log Source: {2}, {3}, Log Message: {4}", Environment.MachineName, Environment.NewLine, "GenerateFingerprintTemplates", Environment.NewLine, "No Fingerprints Images Available"));
                //    //return genericResponse;
                //}


                //foreach (Fingerprint fin in TempFingerList)
                //{
                //    if (fin != null)
                //    {
                //        if (fin.status != 0 && fin.wsqImage != null)
                //        {
                //            FingerList.Add(fin);
                //        }
                //    }
                //}


                // Determine which fingers are available and send them for matching



                //Prepare response structure

                //response = new ISOFingerprintTemplates()
                //{
                //    ReferenceUniqID = Guid.NewGuid().ToString().ToUpper()
                //    ,
                //    fingerprintTemplates = new FingerprintTemplate[10]
                //};
                //cslog.WriteToTransactionLog(string.Format("Log Source Server: {0}, {1}, Log Source: {2}, {3}, Log Message: {4}", Environment.MachineName, Environment.NewLine, "FingerprintIdentification", Environment.NewLine, "Total of: " + FingerList.Count.ToString() + " Recieved For a Template Generation"));
                //cslog.WriteToTransactionLog(string.Format("Log Source Server: {0}, {1}, Log Source: {2}, {3}, Log Message: {4}", Environment.MachineName, Environment.NewLine, "FingerprintIdentification", Environment.NewLine, "Successfully Generated Templates For Reference ID: " + response.ReferenceUniqID));


                //genericResponse = new GenericResponse() { ResponseCode = 1001, ResponseMessage = "Successful fingerprint identification", ResponseObject = response };

                //return genericResponse;
            }
            catch (Exception ex)
            {
                //response = new ISOFingerprintTemplates();
                //cslog.Handle_Exception(ex);
                //genericResponse = new GenericResponse() { ResponseCode = 1006, ResponseMessage = ex.Message.ToUpperInvariant(), ResponseObject = response };
                //return genericResponse;
            }

            return(response);
        }
예제 #8
0
        /// <summary>Unconfirmed service call</summary>
        public NRA_ABIS_Envelope.Response Fingerprint_Insert(NRA_ABIS_Envelope.Request request)
        {
            DateTime request_date_time = DateTime.Now;

            NRA_ABIS_Envelope.EnvelopeType envelope_type = NRA_ABIS_Envelope.EnvelopeType.Fingerprint_Insert;

            NRA_ABIS_Envelope.Response response = null;

            try
            {
                //validate request

                response = Validate.Request(request, envelope_type, request_date_time, true, false, false, true, true, false, false);

                if (response != null)
                {
                    return(response);
                }



                ////validate request

                //if (request == null)
                //{
                //    return new NRA_ABIS_Envelope.Response() { Footer = Request_Exceptions.Set_Exception(envelope_type, Exception_Type.no_request_object) };
                //}

                ////validate header

                //if (request.Header == null)
                //{
                //    return new NRA_ABIS_Envelope.Response() { Footer = Request_Exceptions.Set_Exception(envelope_type, Exception_Type.no_header_object) };
                //}

                //if (request.Header.RequestType == null
                //    ||
                //    request.Header.RequestType != envelope_type)
                //{
                //    return new NRA_ABIS_Envelope.Response() { Footer = Request_Exceptions.Set_Exception(envelope_type, Exception_Type.no_request_type) };
                //}

                ////validate detail

                //if (request.Detail == null)
                //{
                //    return new NRA_ABIS_Envelope.Response() { Footer = Request_Exceptions.Set_Exception(envelope_type, Exception_Type.no_detail_object) };
                //}

                ////validate fingerprint data

                //if (request.Detail.Fingerprint == null)
                //{
                //    return new NRA_ABIS_Envelope.Response() { Footer = Request_Exceptions.Set_Exception(envelope_type, Exception_Type.no_fingerprint_object) };
                //}

                //if (request.Detail.Fingerprint.Count == 0)
                //{
                //    return new NRA_ABIS_Envelope.Response() { Footer = Request_Exceptions.Set_Exception(envelope_type, Exception_Type.no_fingerprint_data) };
                //}



                //return new GenericResponse() { ResponseCode = 1001, ResponseMessage = "Fingerprint Inserted Successful", ResponseObject = null };
            }

            catch (Exception ex)
            {
                //cslog.Handle_Exception(ex);
            }

            return(response);
        }
예제 #9
0
        /// <summary>Asyncronous : Operation for identifying CPR using biometric information</summary>
        public NRA_ABIS_Envelope.Response Biometric_Identification(NRA_ABIS_Envelope.Request request)
        {
            DateTime request_date_time = DateTime.Now;

            NRA_ABIS_Envelope.EnvelopeType envelope_type = NRA_ABIS_Envelope.EnvelopeType.Biometric_Identification;

            NRA_ABIS_Envelope.Response response = null;

            try
            {
                //validate request

                response = Validate.Request(request, envelope_type, request_date_time, true, false, false, true, true, false, false);

                if (response != null)
                {
                    return(response);
                }



                //List<Fingerprint> FingerList = new List<Fingerprint>();
                //List<Fingerprint> TempFingerList = biometricInfo.fingerprints.OfType<Fingerprint>().ToList();

                //if (TempFingerList.Count < 1)
                //{
                //    //response = new IdentificationResponse();
                //    genericResponse = new GenericResponse() { ResponseCode = 1005, ResponseMessage = "No Fingerprints Images Available", ResponseObject = response };

                //    cslog.WriteToTransactionLog(string.Format("Log Source Server: {0}, {1}, Log Source: {2}, {3}, Log Message: {4}", Environment.MachineName, Environment.NewLine, "BiometricIdentification", Environment.NewLine, "No Fingerprints Images Available"));
                //    //return genericResponse;
                //}



                //foreach (Fingerprint fin in TempFingerList)
                //{
                //    if (fin != null)
                //    {
                //        if (fin.status != 0 && fin.wsqImage != null)
                //        {
                //            FingerList.Add(fin);
                //        }
                //    }
                //}



                // Determine which fingers are available and send them for matching
                //response = new IdentificationResponse()
                //{
                //    CPR_ID = long.Parse(DateTime.Now.ToString("yyMMddHHmmssfff"))
                //    ,
                //    ReferenceUniqID = Guid.NewGuid().ToString().ToUpper()
                //};
                //cslog.WriteToTransactionLog(string.Format("Log Source Server: {0}, {1}, Log Source: {2}, {3}, Log Message: {4}", Environment.MachineName, Environment.NewLine, "FingerprintIdentification", Environment.NewLine, "Total of: " + FingerList.Count.ToString() + " Recieved For a Fingerprint Identification"));
                //cslog.WriteToTransactionLog(string.Format("Log Source Server: {0}, {1}, Log Source: {2}, {3}, Log Message: {4}", Environment.MachineName, Environment.NewLine, "FingerprintIdentification", Environment.NewLine, "Sending Transaction with Reference ID: " + response.ReferenceUniqID + " For Fingerprint Identification"));


                //genericResponse = new GenericResponse() { ResponseCode = 1001, ResponseMessage = "Successful Biometric identification", ResponseObject = response };

                //return genericResponse;



                //return

                return(response);
            }

            catch (Exception ex)
            {
                return(new NRA_ABIS_Envelope.Response()
                {
                    Footer = Request_Exceptions.Set_Exception(envelope_type, ex)
                });
            }

            finally
            {
                //set the response date time

                response.Footer.ResponseDateTime = DateTime.Now;
            }
        }
예제 #10
0
        /// <summary>Asynchronuos</summary>
        public NRA_ABIS_Envelope.Response Fingerprint_Identification_Result(NRA_ABIS_Envelope.Request request)
        {
            DateTime request_date_time = DateTime.Now;

            NRA_ABIS_Envelope.EnvelopeType envelope_type = NRA_ABIS_Envelope.EnvelopeType.Fingerprint_Identification_Result;

            NRA_ABIS_Envelope.Response response = null;

            try
            {
                //validate request

                response = Validate.Request(request, envelope_type, request_date_time, true, false, false, true, true, false, false);

                if (response != null)
                {
                    return(response);
                }



                ////validate request

                //if (request == null)
                //{
                //    return new NRA_ABIS_Envelope.Response() { Footer = Request_Exceptions.Set_Exception(envelope_type, Exception_Type.no_request_object) };
                //}

                ////validate header

                //if (request.Header == null)
                //{
                //    return new NRA_ABIS_Envelope.Response() { Footer = Request_Exceptions.Set_Exception(envelope_type, Exception_Type.no_header_object) };
                //}

                //if (request.Header.RequestType == null
                //    ||
                //    request.Header.RequestType != envelope_type)
                //{
                //    return new NRA_ABIS_Envelope.Response() { Footer = Request_Exceptions.Set_Exception(envelope_type, Exception_Type.no_request_type) };
                //}

                //if (string.IsNullOrEmpty(request.Header.ReferenceUID))
                //{
                //    return new NRA_ABIS_Envelope.Response() { Footer = Request_Exceptions.Set_Exception(envelope_type, Exception_Type.no_reference_uid) };
                //}



                ////response = new IdentificationResponse()
                ////{
                ////    CPR_ID = long.Parse(DateTime.Now.ToString("yyMMddHHmmssfff"))
                ////    ,
                ////    ReferenceUniqID = identificationResponse.ReferenceUniqID
                ////};


                ////cslog.WriteToTransactionLog(string.Format("Log Source Server: {0}, {1}, Log Source: {2}, {3}, Log Message: {4}", Environment.MachineName, Environment.NewLine, "FingerprintIdentificationResult Operation", Environment.NewLine, "Sending Transaction with Reference ID: " + response.ReferenceUniqID + " For Fingerprint Identification"));

                //// Determine which fingers are available and send them for matching

                //genericResponse = new GenericResponse() { ResponseCode = 1001, ResponseMessage = "Successful fingerprint identification", ResponseObject = response };

                //return genericResponse;
            }
            catch (Exception ex)
            {
                //response = new IdentificationResponse();
                //cslog.Handle_Exception(ex);
                //genericResponse = new GenericResponse() { ResponseCode = 1006, ResponseMessage = ex.Message.ToUpperInvariant(), ResponseObject = response };
                //return genericResponse;
            }

            return(response);
        }
예제 #11
0
        /// <summary>Synchronous : </summary>
        public NRA_ABIS_Envelope.Response Biometric_Information(NRA_ABIS_Envelope.Request request)
        {
            DateTime request_date_time = DateTime.Now;

            NRA_ABIS_Envelope.EnvelopeType envelope_type = NRA_ABIS_Envelope.EnvelopeType.Biometric_Information;

            NRA_ABIS_Envelope.Response response = null;

            try
            {
                //validate request

                response = Validate.Request(request, envelope_type, request_date_time, true, false, false, true, true, false, false);

                if (response != null)
                {
                    return(response);
                }



                ////validate request

                //if (request == null)
                //{
                //    return new NRA_ABIS_Envelope.Response() { Footer = Request_Exceptions.Set_Exception(envelope_type, Exception_Type.no_request_object) };
                //}

                ////validate header

                //if (request.Header == null)
                //{
                //    return new NRA_ABIS_Envelope.Response() { Footer = Request_Exceptions.Set_Exception(envelope_type, Exception_Type.no_header_object) };
                //}

                //if (request.Header.RequestType == null
                //    ||
                //    request.Header.RequestType != envelope_type)
                //{
                //    return new NRA_ABIS_Envelope.Response() { Footer = Request_Exceptions.Set_Exception(envelope_type, Exception_Type.no_request_type) };
                //}

                //if (request.Header.CPRID == null)
                //{
                //    return new NRA_ABIS_Envelope.Response() { Footer = Request_Exceptions.Set_Exception(envelope_type, Exception_Type.no_cpr_id) };
                //}



                //Prepare response structure

                //response = new BiometricInfo()
                //{
                //    fingerprints = new Fingerprint[10],
                //    portrait = new FacePortrait(),
                //    guid = Guid.NewGuid().ToString().ToUpper(),
                //    signatureImage = new byte[] { 0 }

                //};

                //cslog.WriteToTransactionLog(string.Format("Log Source Server: {0}, {1}, Log Source: {2}, {3}, Log Message: {4}", Environment.MachineName, Environment.NewLine, "GetBiometricInformation", Environment.NewLine, "Successfully Recieved Biometric Information For Reference ID: " + response.guid));


                //genericResponse = new GenericResponse() { ResponseCode = 1001, ResponseMessage = "Successful Recieved Biometric Information", ResponseObject = response };

                //return genericResponse;
            }
            catch (Exception ex)
            {
                //response = new BiometricInfo();
                //cslog.Handle_Exception(ex);
                //genericResponse = new GenericResponse() { ResponseCode = 1006, ResponseMessage = ex.Message.ToUpperInvariant(), ResponseObject = response };
                //return genericResponse;
            }

            return(response);
        }
예제 #12
0
        /// <summary>Asyncronous : </summary>
        public NRA_ABIS_Envelope.Response Biometric_Identification_Result(NRA_ABIS_Envelope.Request request)
        {
            DateTime request_date_time = DateTime.Now;

            NRA_ABIS_Envelope.EnvelopeType envelope_type = NRA_ABIS_Envelope.EnvelopeType.Biometric_Identification_Result;

            NRA_ABIS_Envelope.Response response = null;

            try
            {
                //validate request

                response = Validate.Request(request, envelope_type, request_date_time, true, false, false, true, true, false, false);

                if (response != null)
                {
                    return(response);
                }



                ////validate request

                //if (request == null)
                //{
                //    return new NRA_ABIS_Envelope.Response() { Footer = Request_Exceptions.Set_Exception(envelope_type, Exception_Type.no_request_object) };
                //}

                ////validate header

                //if (request.Header == null)
                //{
                //    return new NRA_ABIS_Envelope.Response() { Footer = Request_Exceptions.Set_Exception(envelope_type, Exception_Type.no_header_object) };
                //}

                //if (request.Header.RequestType == null
                //    ||
                //    request.Header.RequestType != envelope_type)
                //{
                //    return new NRA_ABIS_Envelope.Response() { Footer = Request_Exceptions.Set_Exception(envelope_type, Exception_Type.no_request_type) };
                //}

                //if (string.IsNullOrEmpty(request.Header.ReferenceUID))
                //{
                //    return new NRA_ABIS_Envelope.Response() { Footer = Request_Exceptions.Set_Exception(envelope_type, Exception_Type.no_reference_uid) };
                //}

                ////validate detail

                //if (request.Detail == null)
                //{
                //    return new NRA_ABIS_Envelope.Response() { Footer = Request_Exceptions.Set_Exception(envelope_type, Exception_Type.no_detail_object) };
                //}

                ////validate fingerprint data

                //if (request.Detail.Fingerprint == null)
                //{
                //    return new NRA_ABIS_Envelope.Response() { Footer = Request_Exceptions.Set_Exception(envelope_type, Exception_Type.no_fingerprint_object) };
                //}

                //if (request.Detail.Fingerprint.Count == 0)
                //{
                //    return new NRA_ABIS_Envelope.Response() { Footer = Request_Exceptions.Set_Exception(envelope_type, Exception_Type.no_fingerprint_data) };
                //}

                //for (int i = 0; i < request.Detail.Fingerprint.Count; i++)
                //{
                //    if (request.Detail.Fingerprint[i].ImageData.Length < min_fingerprint_image_data_length)
                //    {
                //        return new NRA_ABIS_Envelope.Response() { Footer = Request_Exceptions.Set_Exception(envelope_type, Exception_Type.no_fingerprint_image_data, i) };
                //    }
                //}

                ////validate portrait data

                //if (request.Detail.Portrait == null)
                //{
                //    return new NRA_ABIS_Envelope.Response() { Footer = Request_Exceptions.Set_Exception(envelope_type, Exception_Type.no_portrait_object) };
                //}

                //if (request.Detail.Portrait.Count == 0)
                //{
                //    return new NRA_ABIS_Envelope.Response() { Footer = Request_Exceptions.Set_Exception(envelope_type, Exception_Type.no_portrait_data) };
                //}

                //for (int i = 0; i < request.Detail.Portrait.Count; i++)
                //{
                //    if (request.Detail.Portrait[i].ImageDataICAO.Length < min_portrait_image_data_icao_length)
                //    {
                //        return new NRA_ABIS_Envelope.Response() { Footer = Request_Exceptions.Set_Exception(envelope_type, Exception_Type.no_portrait_image_data_icao, i) };
                //    }

                //    if (request.Detail.Portrait[i].ImageDataOriginal.Length < min_portrait_image_data_original_length)
                //    {
                //        return new NRA_ABIS_Envelope.Response() { Footer = Request_Exceptions.Set_Exception(envelope_type, Exception_Type.no_portrait_image_data_original, i) };
                //    }
                //}

                //validate signature data


                //validate template data

                //if (request.Detail.Fingerprint[i].Template.Length < min_fingerprint_template_length)
                //{
                //    return new NRA_ABIS_Envelope.Response() { Footer = Request_Exceptions.Set_Exception(envelope_type, Exception_Type.no_fingerprint_template_data, i) };
                //}



                ////face identification reuslt

                //cslog.WriteToTransactionLog(string.Format("Log Source Server: {0}, {1}, Log Source: {2}, {3}, Log Message: {4}", Environment.MachineName, Environment.NewLine, "BiometricIdentificationResult", Environment.NewLine, "Sending transaction with reference id " + identificationResultRequest.ReferenceUniqID + " for Biometric identification"));



                //populate identification response

                //response = new IdentificationResponse()
                //{
                //    CPR_ID = long.Parse(DateTime.Now.ToString("yyMMddHHmmssfff")),
                //    ReferenceUniqID = identificationResultRequest.ReferenceUniqID
                //};

                //genericResponse = new GenericResponse() { ResponseCode = 1001, ResponseMessage = "Reference unique id not supplied", ResponseObject = response };

                //return genericResponse;
            }

            catch (Exception ex)
            {
                //response = new IdentificationResponse();
                //cslog.Handle_Exception(ex);
                //genericResponse = new GenericResponse() { ResponseCode = 1006, ResponseMessage = ex.Message.ToUpperInvariant(), ResponseObject = response };
                //return genericResponse;
            }

            return(response);
        }
예제 #13
0
        /// <summary>Synchronous</summary>
        public NRA_ABIS_Envelope.Response Portrait_Verification(NRA_ABIS_Envelope.Request request)
        {
            DateTime request_date_time = DateTime.Now;

            NRA_ABIS_Envelope.EnvelopeType envelope_type = NRA_ABIS_Envelope.EnvelopeType.Portrait_Verification;

            NRA_ABIS_Envelope.Response response = null;

            try
            {
                //validate request

                response = Validate.Request(request, envelope_type, request_date_time, true, false, false, true, true, false, false);

                if (response != null)
                {
                    return(response);
                }



                ////validate request

                //if (request == null)
                //{
                //    return new NRA_ABIS_Envelope.Response() { Footer = Request_Exceptions.Set_Exception(envelope_type, Exception_Type.no_request_object) };
                //}

                ////validate header

                //if (request.Header == null)
                //{
                //    return new NRA_ABIS_Envelope.Response() { Footer = Request_Exceptions.Set_Exception(envelope_type, Exception_Type.no_header_object) };
                //}

                //if (request.Header.RequestType == null
                //    ||
                //    request.Header.RequestType != envelope_type)
                //{
                //    return new NRA_ABIS_Envelope.Response() { Footer = Request_Exceptions.Set_Exception(envelope_type, Exception_Type.no_request_type) };
                //}

                //if (request.Header.CPRID == null)
                //{
                //    return new NRA_ABIS_Envelope.Response() { Footer = Request_Exceptions.Set_Exception(envelope_type, Exception_Type.no_cpr_id) };
                //}

                ////validate detail

                //if (request.Detail == null)
                //{
                //    return new NRA_ABIS_Envelope.Response() { Footer = Request_Exceptions.Set_Exception(envelope_type, Exception_Type.no_detail_object) };
                //}

                ////validate portrait data

                //if (request.Detail.Portrait == null)
                //{
                //    return new NRA_ABIS_Envelope.Response() { Footer = Request_Exceptions.Set_Exception(envelope_type, Exception_Type.no_portrait_object) };
                //}

                //if (request.Detail.Portrait.Count == 0)
                //{
                //    return new NRA_ABIS_Envelope.Response() { Footer = Request_Exceptions.Set_Exception(envelope_type, Exception_Type.no_portrait_data) };
                //}



                ////call matcher to match portrait

                //cslog.WriteToTransactionLog(string.Format("Log Source Server: {0}, {1}, Log Message: {2}", Environment.MachineName, Environment.NewLine, "FacialPortraitVerification", Environment.NewLine, "Portrait available"));



                //populate verification response with match results

                //response = new VerificationResponse()
                //{
                //    ReferenceUniqID = Guid.NewGuid().ToString().ToUpper()
                //    ,
                //    result = true
                //};
            }
            catch (Exception ex)
            {
                //response = new VerificationResponse() { result = false };

                //cs/*l*/og.Handle_Exception(ex);
            }

            return(response);
        }