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;
        }
示例#2
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);
        }