Skip to content

Commit 7663881

Browse files
committed
Fixed domain extraction from epp poll message
1 parent be28ec0 commit 7663881

1 file changed

Lines changed: 36 additions & 1 deletion

File tree

‎EppLib/Entities/PollResponse.cs‎

Lines changed: 36 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -64,20 +64,55 @@ protected override void ProcessDataNode(XmlDocument doc, XmlNamespaceManager nam
6464

6565
if (resData != null)
6666
{
67-
ResultData = resData.InnerXml;
67+
ResultData = resData.InnerXml;
6868
XmlNode msgIDNode = resData.SelectSingleNode("poll:msgID", namespaces);
6969

7070
if (msgIDNode != null)
7171
{
7272
MsgId = msgIDNode.InnerText;
7373
}
7474

75+
// Old code for extracting the domain name
7576
XmlNode domainNameNode = resData.SelectSingleNode("poll:domainName", namespaces);
7677

7778
if (domainNameNode != null)
7879
{
7980
DomainName = domainNameNode.InnerText;
8081
}
82+
83+
XmlNamespaceManager domNamespaces = new XmlNamespaceManager(doc.NameTable);
84+
domNamespaces.AddNamespace("iis", "urn:se:iis:xml:epp:iis-1.2");
85+
domNamespaces.AddNamespace("dom", "urn:ietf:params:xml:ns:domain-1.0");
86+
87+
// try to extract the domain name if it's an update notify messge
88+
if (DomainName == null || DomainName.Length == 0)
89+
{
90+
XmlNode domNameNode = resData.SelectSingleNode("iis:updateNotify/dom:infData/dom:name", domNamespaces);
91+
if (domNameNode != null)
92+
{
93+
DomainName = domNameNode.InnerText;
94+
}
95+
}
96+
97+
// try to extract the domain name if it's a domain delete message
98+
if (DomainName == null || DomainName.Length == 0)
99+
{
100+
XmlNode delNameNode = resData.SelectSingleNode("iis:deleteNotify/dom:delete/dom:name", domNamespaces);
101+
if (delNameNode != null)
102+
{
103+
DomainName = delNameNode.InnerText;
104+
}
105+
}
106+
107+
// try to extract the domain name if it's a domain transfer message
108+
if (DomainName == null || DomainName.Length == 0)
109+
{
110+
XmlNode transNameNode = resData.SelectSingleNode("iis:transferNotify/dom:trnData/dom:name", domNamespaces);
111+
if (transNameNode != null)
112+
{
113+
DomainName = transNameNode.InnerText;
114+
}
115+
}
81116
}
82117
}
83118

0 commit comments

Comments
 (0)