public Lrap1Response Send(RequestApplicationToChangeRegisterV1_0Type webRequest, string username, string password)
        {
            // create an instance of the client
            var client = new EdrsSubmissionService.EDocumentRegistrationV1_0ServiceClient();

            client.ChannelFactory.Credentials.ClientCertificate.SetCertificate(StoreLocation.CurrentUser, StoreName.My,
                X509FindType.FindBySerialNumber, "47 ce 29 6f");

            // create a Header Instance
            client.ChannelFactory.Endpoint.Behaviors.Add(new HMLRBGMessageEndpointBehavior(username, password));

            // submit the request
            var serviceResponse = client.eDocumentRegistration(webRequest);

            var lrap1Response = new Lrap1Response();

            switch (serviceResponse.GatewayResponse.TypeCode)
            {
                case ProductResponseCodeContentType.Item10:
                    lrap1Response.ResponseType = ResponseType.Acknowledgment;
                    break;
                case ProductResponseCodeContentType.Item20:
                    lrap1Response.ResponseType = ResponseType.Rejection;
                    break;
            }
            return lrap1Response;
        }
Exemplo n.º 2
0
        public bool Submit()
        {
            try
            {
                EdrsSubmissionService.RequestApplicationToChangeRegisterV1_0Type request;

                request =
                    ObjectSerializer
                        .XmlDeserializeFromString<EdrsSubmissionService.RequestApplicationToChangeRegisterV1_0Type>(
                            Payload);

                request.MessageId = MessageId;

                // create an instance of the client
                var client = new EdrsSubmissionService.EDocumentRegistrationV1_0ServiceClient();

                // create a Header Instance
                client.ChannelFactory.Endpoint.Behaviors.Add(new HMLRBGMessageEndpointBehavior(Username, Password));

                // submit the request
                _serviceResponse = client.eDocumentRegistration(request);
            }
            catch (DeserializationException ex)
            {
                throw new InvalidPayloadException("Payload is invalid",ex);
            }
            return true;
        }
Exemplo n.º 3
0
        public Lrap1Response Send(RequestApplicationToChangeRegisterV1_0Type webRequest, string username, string password)
        {
            // create an instance of the client
            var client = new EdrsSubmissionService.EDocumentRegistrationV1_0ServiceClient();

            client.ChannelFactory.Credentials.ClientCertificate.SetCertificate(StoreLocation.CurrentUser, StoreName.My,
                                                                               X509FindType.FindBySerialNumber, "47 ce 29 6f");

            // create a Header Instance
            client.ChannelFactory.Endpoint.Behaviors.Add(new HMLRBGMessageEndpointBehavior(username, password));

            // submit the request
            var serviceResponse = client.eDocumentRegistration(webRequest);

            var lrap1Response = new Lrap1Response();

            switch (serviceResponse.GatewayResponse.TypeCode)
            {
            case ProductResponseCodeContentType.Item10:
                lrap1Response.ResponseType = ResponseType.Acknowledgment;
                break;

            case ProductResponseCodeContentType.Item20:
                lrap1Response.ResponseType = ResponseType.Rejection;
                break;
            }
            return(lrap1Response);
        }