public Lrap1Response Send(newAttachmentRequest webRequest, string username, string password)
        {
            Lrap1AttachmentRequest request;
            // create an instance of the client
            var client = new EdrsAttachmentService.AttachmentV1_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.newAttachment(webRequest.arg0);

            var lrap1Response = new Lrap1Response();

            switch (serviceResponse.GatewayResponse.TypeCode)
            {
                case EdrsAttachmentService.ProductResponseCodeContentType.Item10:
                    lrap1Response.ResponseType = ResponseType.Acknowledgment;
                    break;
                case EdrsAttachmentService.ProductResponseCodeContentType.Item20:
                    lrap1Response.ResponseType = ResponseType.Rejection;
                    break;
            }
            return lrap1Response;
        }
Ejemplo n.º 2
0
        public bool Submit()
        {
            EdrsAttachmentService.newAttachmentRequest request;
            try
            {
                request =
                    ObjectSerializer.XmlDeserializeFromString<EdrsAttachmentService.newAttachmentRequest>(Payload);
            }
            catch
            {
                return false;
            }

            request.arg0.ApplicationMessageId = ApplicationMessageId;
            request.arg0.MessageId = MessageId;

            // create an instance of the client
            var client = new EdrsAttachmentService.AttachmentV1_0ServiceClient();

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

            // submit the request
            _serviceResponse = client.newAttachment(request.arg0);

            return true;
        }