protected override void ProcessDataNode(XmlDocument doc, XmlNamespaceManager namespaces)
		{
			base.ProcessDataNode(doc, namespaces);

			namespaces.AddNamespace("n", "http://www.nominet.org.uk/epp/xml/std-notifications-1.0");
			var registrarChangeNode = doc.SelectSingleNode("/ns:epp/ns:response/ns:resData/n:rcData", namespaces);

			if (registrarChangeNode != null)
			{
				var originatorNode = registrarChangeNode.SelectSingleNode("n:orig", namespaces);
				if (originatorNode != null)
				{
					Originator = originatorNode.InnerText;
				}

				var registrarNode = registrarChangeNode.SelectSingleNode("n:registrarTag", namespaces);
				if (registrarNode != null)
				{
					RegistrarTag = registrarNode.InnerText;
				}

				// Added by Brian Wojtczak, Fasthosts
				var caseNode = registrarChangeNode.SelectSingleNode("n:caseId", namespaces);
				if (caseNode != null)
				{
					CaseId = caseNode.InnerText;
				}

				var domainListNode = registrarChangeNode.SelectSingleNode("n:domainListData", namespaces);
				if (domainListNode != null)
				{
					namespaces.AddNamespace("domain", "urn:ietf:params:xml:ns:domain-1.0");
					var domainNodes = domainListNode.SelectNodes("domain:infData", namespaces);

					if (domainNodes != null)
					{
						DomainList = new List<Domain>();
						foreach (XmlNode node in domainNodes)
						{
							var domainRes = new DomainInfoResponse(node.OuterXml);
							DomainList.Add(domainRes.Domain);
						}
					}
				}

				namespaces.AddNamespace("contact", "urn:ietf:params:xml:ns:contact-1.0");
				var contactNode = registrarChangeNode.SelectSingleNode("contact:infData", namespaces);
				if (contactNode != null)
				{
					var contactRes = new ContactInfoResponse(contactNode.OuterXml);
					Contact = contactRes.Contact;
				}
			}
		}
Exemple #2
0
        public void TestContactInfoResponse1()
        {
            byte[] input = File.ReadAllBytes("ContactInfoResponse1.xml");
            var response = new ContactInfoResponse(input);
            var contact = response.Contact;

            Assert.AreEqual("1000", response.Code);
            Assert.AreEqual("Command completed successfully", response.Message);

            Assert.AreEqual("sh8013", contact.Id);

            Assert.AreEqual("+1.7035555555", contact.Voice.Value);
            Assert.AreEqual("1234", contact.Voice.Extension);
            Assert.AreEqual("+1.7035555556", contact.Fax.Value);
            Assert.AreEqual("*****@*****.**", contact.Email);

            Assert.AreEqual("int", contact.PostalInfo.m_type);
            Assert.AreEqual("John Doe", contact.PostalInfo.m_name);
            Assert.AreEqual("Example Inc.", contact.PostalInfo.m_org);

            Assert.AreEqual("123 Example Dr.", contact.PostalInfo.m_address.Street1);
            Assert.AreEqual("Suite 100", contact.PostalInfo.m_address.Street2);
            Assert.IsNull(contact.PostalInfo.m_address.Street3);
            Assert.AreEqual("Dulles", contact.PostalInfo.m_address.City);
            Assert.AreEqual("VA", contact.PostalInfo.m_address.StateProvince);
            Assert.AreEqual("20166-6503", contact.PostalInfo.m_address.PostalCode);
            Assert.AreEqual("US", contact.PostalInfo.m_address.CountryCode);

            Assert.AreEqual("SH8013-REP", contact.Roid);
            Assert.IsTrue(contact.StatusList.Contains("linked"));
            Assert.IsTrue(contact.StatusList.Contains("clientDeleteProhibited"));
            Assert.AreEqual("ClientY", contact.ClId);
            Assert.AreEqual("ClientX", contact.CrId);
            Assert.AreEqual("ClientX", contact.UpId);
            Assert.AreEqual("1999-04-03T22:00:00.0Z", contact.CrDate);
            Assert.AreEqual("1999-12-03T09:00:00.0Z", contact.UpDate);
            Assert.AreEqual("2000-04-08T09:00:00.0Z", contact.TrDate);

            Assert.AreEqual("2fooBAR", contact.Password);
            Assert.AreEqual(Contact.DiscloseFlags.All & ~Contact.DiscloseFlags.Voice & ~Contact.DiscloseFlags.Email, contact.DiscloseMask);

            Assert.AreEqual("ABC-12345", response.ClientTransactionId);
            Assert.AreEqual("54322-XYZ", response.ServerTransactionId);
        }