Example #1
0
        /// <summary>
        /// Получить статус обработки запроса
        /// </summary>
        /// <param name="_orgPPAGUID">
        /// Идентификатор зарегистрированной организации
        /// </param>
        /// <param name="_ackImpSupNotifOrderExec">
        /// Идентификатор сообщения, присвоенный ГИС ЖКХ
        /// </param>
        /// <returns></returns>
        public getStateResponse P_GetState(string _orgPPAGUID, string _ackImpSupNotifOrderExec)
        {
            var srvPaymentSrvAsync = new PaymentPortsTypeAsyncClient();

            srvPaymentSrvAsync.ClientCredentials.UserName.UserName = ConfigurationManager.AppSettings["_login"];
            srvPaymentSrvAsync.ClientCredentials.UserName.Password = ConfigurationManager.AppSettings["_pass"];

            var reqImpSupNotifOrderExec_GS = new getStateRequest1
            {
                RequestHeader = new RequestHeader
                {
                    Date            = DateTime.Now,
                    MessageGUID     = Guid.NewGuid().ToString(),
                    ItemElementName = ItemChoiceType.orgPPAGUID,
                    Item            = _orgPPAGUID
                },
                getStateRequest = new getStateRequest
                {
                    MessageGUID = _ackImpSupNotifOrderExec
                }
            };

            var resGetState = srvPaymentSrvAsync.getState(reqImpSupNotifOrderExec_GS);

            return(resGetState);
        }
Example #2
0
        public bool TryGetResult(IAck ack, out IGetStateResult result)
        {
            using (var client = new PaymentPortsTypeAsyncClient(_binding, _remoteAddress)) {
                client.Endpoint.EndpointBehaviors.Add(new MyEndpointBehavior());

                if (!_config.IsPPAK)
                {
                    client.ClientCredentials.UserName.UserName = Constants.UserAuth.Name;
                    client.ClientCredentials.UserName.Password = Constants.UserAuth.Passwd;
                }

                if (!_config.UseTunnel)
                {
                    client.ClientCredentials.ClientCertificate.SetCertificate(
                        StoreLocation.CurrentUser,
                        StoreName.My,
                        X509FindType.FindByThumbprint,
                        base._config.CertificateThumbprint);
                }

                var responce = client.getState(new getStateRequest1 {
                    RequestHeader   = RequestHelper.Create <RequestHeader>(_config.OrgPPAGUID, _config.Role),
                    getStateRequest = new getStateRequest {
                        MessageGUID = ack.MessageGUID
                    }
                });

                if (responce.getStateResult.RequestState == 3)
                {
                    result = responce.getStateResult;
                    return(true);
                }

                result = null;
                return(false);
            }
        }