Beispiel #1
0
        private GetRecipientConfigurationsResponse parseGetRecipientConfigurations(ServiceResponse Response)
        {
            GetRecipientConfigurationsResponse response = Response.Factory <GetRecipientConfigurationsResponse>();

            if (Response.IsSuccess)
            {
                try
                {
                    XElement configResponse = Response.SOAPContent.Element(NS_SOAP_ENV + "Body").Element(NS_ACTION + "GetRecipientConfigurationsResponse").Element(NS_ACTION + "RecipientConfigurations");
                    RecipientConfiguration recipient;

                    foreach (XElement el in configResponse.Elements())
                    {
                        recipient = new RecipientConfiguration();
                        recipient.ConfigurationID = int.Parse(el.Element(NS_ACTION + "ConfigurationID").Value);
                        recipient.TemplateToken   = el.Element(NS_ACTION + "TemplateToken").Value;
                        recipient.Name            = el.Element(NS_ACTION + "Name").Value;

                        foreach (XElement element in el.Element(NS_ACTION + "Parameters").Elements())
                        {
                            recipient.Parameters.Add(
                                element.Attribute("Name").Value, element.Attribute("Value").Value
                                );
                        }

                        response.Configurations.Add(recipient);
                    }
                }
                catch (Exception ex)
                {
                    Response.IsSuccess = false;
                    Response.Content   = "[ParseRecipientConfigurations] " + ex.Message;
                }
            }

            return(response);
        }
Beispiel #2
0
        public async Task Get_RecipientConfig()
        {
            GetRecipientConfigurationsResponse response = await actionService.GetRecipientConfigurationsAsync(VALID_IP, VALID_USER, VALID_PASS);

            Assert.IsTrue(response.IsSuccess && response.HttpStatusCode == System.Net.HttpStatusCode.OK && !response.SOAPContent.IsEmpty && response.Configurations != null);
        }