Exemplo n.º 1
0
        public ContactSet(OPS_envelope response)
        {
            var contacts = (dt_assoc)OpsObjectHelper.GetResponseAttributeItem(response, "contact_set").Item;

            if (contacts != null)
            {
                var adminContact   = OpsObjectHelper.GetItemFromArray(contacts, "admin");
                var billingContact = OpsObjectHelper.GetItemFromArray(contacts, "billing");
                var ownerContact   = OpsObjectHelper.GetItemFromArray(contacts, "owner");
                var techContact    = OpsObjectHelper.GetItemFromArray(contacts, "tech");

                if (adminContact != null)
                {
                    admin = new Contact(adminContact);
                }
                if (billingContact != null)
                {
                    billing = new Contact(billingContact);
                }
                if (ownerContact != null)
                {
                    owner = new Contact(ownerContact);
                }
                if (techContact != null)
                {
                    tech = new Contact(techContact);
                }
            }
        }
Exemplo n.º 2
0
        public TldData(OPS_envelope response)
        {
            var tldDataItem = OpsObjectHelper.GetResponseAttributeItem(response, "tld_data");

            if (tldDataItem != null)
            {
                var tldData = (dt_assoc)tldDataItem.Item;
                if (tldData != null)
                {
                    var auRegistrantInfoItem = OpsObjectHelper.GetItemFromArray(tldData, "au_registrant_info");
                    if (auRegistrantInfoItem != null)
                    {
                        au_registrant_info = new AuRegistrantInfo(auRegistrantInfoItem);
                    }

                    var brRegisterNumberItem = OpsObjectHelper.GetItemFromArray(tldData, "br_register_number");
                    if (brRegisterNumberItem != null)
                    {
                        br_register_number = brRegisterNumberItem.Text;
                    }

                    var cedInfoItem = OpsObjectHelper.GetItemFromArray(tldData, "ced_info");
                    if (cedInfoItem != null)
                    {
                        ced_info = new CedInfo(cedInfoItem);
                    }

                    var iprDataItem = OpsObjectHelper.GetItemFromArray(tldData, "ipr_data");
                    if (iprDataItem != null)
                    {
                        ipr_data = new IprData(iprDataItem);
                    }

                    var itRegistrantInfoItem = OpsObjectHelper.GetItemFromArray(tldData, "it_registrant_info");
                    if (itRegistrantInfoItem != null)
                    {
                        it_registrant_info = new ItRegistrantInfo(itRegistrantInfoItem);
                    }

                    var nexusItem = OpsObjectHelper.GetItemFromArray(tldData, "nexus");
                    if (nexusItem != null)
                    {
                        nexus = new Nexus(nexusItem);
                    }

                    var professionalDataItem = OpsObjectHelper.GetItemFromArray(tldData, "professional_data");
                    if (professionalDataItem != null)
                    {
                        professional_data = new ProfessionalData(professionalDataItem);
                    }

                    var registrantExtraInfoItem = OpsObjectHelper.GetItemFromArray(tldData, "registrant_extra_info");
                    if (registrantExtraInfoItem != null)
                    {
                        registrant_extra_info = new RegistrantExtraInfo(registrantExtraInfoItem);
                    }
                }
            }
        }
Exemplo n.º 3
0
 public ResponseBase(string xml)
 {
     Xml = xml;
     ResponseEnvelope = SerializationHelper.Deserialize <OPS_envelope>(xml);
     Protocol         = OpsObjectHelper.GetResponseDataBlockItem(ResponseEnvelope, "protocol").Text;
     Action           = OpsObjectHelper.GetResponseDataBlockItem(ResponseEnvelope, "action").Text;
     Object           = OpsObjectHelper.GetResponseDataBlockItem(ResponseEnvelope, "object").Text;
     IsSuccess        = OpsObjectHelper.SrsBoolToNetBool(OpsObjectHelper.GetResponseDataBlockItem(ResponseEnvelope, "is_success").Text);
     ResponseCode     = Convert.ToInt64(OpsObjectHelper.GetResponseDataBlockItem(ResponseEnvelope, "response_code").Text);
     ResponseText     = OpsObjectHelper.GetResponseDataBlockItem(ResponseEnvelope, "response_text").Text;
 }
Exemplo n.º 4
0
        /// <summary>
        /// Returns an item from a response stored in the dt_assoc array with the specified key
        /// </summary>
        public static item GetResponseDataBlockItem(OPS_envelope response, string key)
        {
            var responseBodyArray = (dt_assoc)response.body.data_block.Item;

            if (responseBodyArray == null)
            {
                return(null);
            }

            return(GetItemFromArray(responseBodyArray, key));
        }
Exemplo n.º 5
0
        /// <summary>
        /// Returns an item from a response stored in the attributes dt_assoc array with the specified key
        /// </summary>
        public static item GetResponseAttributeItem(OPS_envelope response, string key)
        {
            var responseBodyArray = (dt_assoc)response.body.data_block.Item;
            var attributes        = GetItemFromArray(responseBodyArray, "attributes");

            if (attributes == null)
            {
                return(null);
            }

            var responseAttributesArray = (dt_assoc)attributes.Item;

            return(GetItemFromArray(responseAttributesArray, key));
        }