Пример #1
0
        /// <summary>
        /// validate Mandatory fields
        /// </summary>
        private FaultResponse MandatoryParameterMissing(string Description)
        {
            FaultResponse FaultResponse = new FaultResponse();

            FaultResponse.statusCode = "SPD_MandatoryParameterMissing";
            FaultResponse.SDPStatusLine.statusCode        = "SPD_MandatoryParameterMissing";
            FaultResponse.SDPStatusLine.statusDescription = Description;
            FaultResponse.SDPStatusLine.Severity          = "CRITICAL";
            FaultResponse.statusTime = DateTime.Now;
            FaultResponse.SDPStatusLine.stepStatusTime = DateTime.Now;
            return(FaultResponse);
        }
Пример #2
0
        public PortInNotificationResponse portInNotification(PortInNotificationRequest Request)
        {
            FaultResponse FaultResponse;

            PortInNotificationResponse PortInNotificationResponse = new PortInNotificationResponse();

            //  Check the Reference Id is not null
            if (Request.PortInNotification.referenceID.Id == null)
            {
                FaultResponse            = new FaultResponse();
                FaultResponse.statusCode = "SPD_MandatoryParameterMissing";
                FaultResponse.SDPStatusLine.statusCode        = "SPD_MandatoryParameterMissing";
                FaultResponse.SDPStatusLine.statusDescription = "Missing Reference Id";
                FaultResponse.SDPStatusLine.Severity          = "CRITICAL";
                FaultResponse.statusTime = DateTime.Now;
                FaultResponse.SDPStatusLine.stepStatusTime = DateTime.Now;
                FaultResponse.consumerReferenceId          = Request.sdpServiceHeaders.consumerReferenceId;
                throw new FaultException <FaultResponse>(FaultResponse);
            }
            //  Invalid Reference Id
            if (Request.PortInNotification.referenceID.Id != "VT40000287_160727")
            {
                FaultResponse            = new FaultResponse();
                FaultResponse.statusCode = "SPD_InputValidationFault";
                FaultResponse.SDPStatusLine.statusCode        = "SPD_InputValidationFault";
                FaultResponse.SDPStatusLine.statusDescription = "Invalid Reference Id";
                FaultResponse.SDPStatusLine.Severity          = "CRITICAL";
                FaultResponse.statusTime = DateTime.Now;
                FaultResponse.SDPStatusLine.stepStatusTime = DateTime.Now;
                FaultResponse.consumerReferenceId          = Request.sdpServiceHeaders.consumerReferenceId;
                throw new FaultException <FaultResponse>(FaultResponse);
            }
            //  Check the MSISDN
            if (Request.PortInNotification.serviceID.serviceID == null)
            {
                FaultResponse            = new FaultResponse();
                FaultResponse.statusCode = "SPD_MandatoryParameterMissing";
                FaultResponse.SDPStatusLine.statusCode        = "SPD_MandatoryParameterMissing";
                FaultResponse.SDPStatusLine.statusDescription = "Missing Service Number";
                FaultResponse.SDPStatusLine.Severity          = "CRITICAL";
                FaultResponse.statusTime = DateTime.Now;
                FaultResponse.SDPStatusLine.stepStatusTime = DateTime.Now;
                FaultResponse.consumerReferenceId          = Request.sdpServiceHeaders.consumerReferenceId;
                throw new FaultException <FaultResponse>(FaultResponse);
            }

            //  Invalid MSISDN
            if (Request.PortInNotification.serviceID.serviceID != "98340654")
            {
                FaultResponse            = new FaultResponse();
                FaultResponse.statusCode = "SPD_InputValidationFault";
                FaultResponse.SDPStatusLine.statusCode        = "SPD_InputValidationFault";
                FaultResponse.SDPStatusLine.statusDescription = "Invalid Service Number";
                FaultResponse.SDPStatusLine.Severity          = "CRITICAL";
                FaultResponse.statusTime = DateTime.Now;
                FaultResponse.SDPStatusLine.stepStatusTime = DateTime.Now;
                FaultResponse.consumerReferenceId          = Request.sdpServiceHeaders.consumerReferenceId;
                throw new FaultException <FaultResponse>(FaultResponse);
            }

            PortInNotificationResponse = new PortInNotificationResponse();

            PortInNotificationResponse.RequestId        = Request.PortInNotification.requestID.Id;
            PortInNotificationResponse.ReferenceId      = Request.PortInNotification.referenceID.Id;
            PortInNotificationResponse.ResponseDateTime = DateTime.Now;
            PortInNotificationResponse.RequestDateTime  = Request.sdpServiceHeaders.consumerReferenceDateTime;
            PortInNotificationResponse.Results          = "SUCCESS";

            return(PortInNotificationResponse);
        }