📄 api user guide.txt
字号:
------------------------------------------------------------------------------------------
Domain registration interface presentation programs guide
------------------------------------------------------------------------------------------
1. Pich up SCP server address, port, SCP account and password from "web.config"
string HostName = ConfigurationSettings.AppSettings["HostName"]; #SCP Server Address
int HostPort = Convert.ToInt32(ConfigurationSettings.AppSettings["HostPort"]); #SCP Server port
string VCPID = ConfigurationSettings.AppSettings["VCPID"]; #SCP username
string VCPPassword = ConfigurationSettings.AppSettings["VCPPassword"]; #SCP password
Since the SCP server address, port, SCP account and password are put into file "web.config", you can use the same method to acquire them in every web page.
2. Transfer presentation programs core: dll programs
<%@ Import Namespace="com.todayisp.NowClient" %>
NowClient.dll is a encoded code grossp that is put in the file bin under the the root catalogue. You can make a domain hosting at the top of each page.
3. Design genus "SendXML" for sending XML
SendXML myClient = new SendXML(HostName, HostPort, VCPID, VCPPassword);
Design genus SendXML, you can trasnfer the SCPserver address, port, account and password to initialize this genus.
4. Organize and generate character string of XML format, and send the XML to SCP server
There are two methods to design XML, you can design a intuitionistic XMLcharacter string
string xml = "<action>"+domainSuffix(Request.Form["domain"])+":createDomain</action>\n"+
"<domain:name>"+Request.Form["domain"]+"</domain:name>\n"+
"<domain:period>"+Request.Form["period"]+"</domain:period>\n"+
... ...
myClient.Add(xml);
myClient.Send();
sendXML=myClient.getsendXML();
Or you can use genus SendXML
Hashtable KeyValue = new Hashtable();
KeyValue["action"]=domainSuffix(domains)+":checkDomain";
KeyValue["domain:name"]=domains;
... ...
myClient.Add(KeyValue);
myClient.Send();
sendXML=myClient.getsendXML();
5. Design genus ReceiveXML to receive XML
ReceiveXML receivexml = new ReceiveXML(myClient.getresponseXML());
myClient.getresponseXML () is a method which is used to receive returned XML when sending XML. You can use returned information as parameter to transfer into ReceiveXML
6. Handle returned XML information
string msg = receivexml.getMsg(); #acquire information of <msg>
string code = receivexml.getCode(); #Acquireinformation of <code>
bool isSuccess = receivexml.isSuccess(); #Judge if the command sent has been handled successfully or not
string responseXML=receivexml.getXML(myClient.getresponseXML()); #Acquire character string of returned XML information
Hashtable resdataHash=receivexml.getResData(); Hashtable collection that is used to return data
string domain = resdataHash["domain:name"].ToString(); #to get<domain:name>abc.com abc.com from resdataHashin<domain:name>
... ...
#Acquire abc.com of <domain:name>abc.com<domain:name> from resdataHash
string type = receivexml.getResDataNode("domain:contact","type"); #Acquire type result from domain:contact type= "admin" pw=****** #If there are many <domain:contact>, you can use ; to seperate the character string
7. Handle domain extension
private string domainSuffix(string domain){
string lastSuffix=domain.Substring(domain.LastIndexOf(".")+1,domain.Length-domain.LastIndexOf(".")-1);
return "dot"+lastSuffix;
}
The domain extension will return after you transmit the domain name. For example, abc.com will return dotcom, abc.com will return dotcn etc.
Return:
1. Tab <result> indicates the returned operation information, code indicates the operation status, <msg> is information note.
If successfuly, it is as follows:
2000 Command completed successfully
.
Registration failure, this domain name has been registered.
4005 *.* has been registered,pls choose other one
.
Wrong ingormation (If it's not the domain name of the registrant, then it should be the information that is lacked.)
4002 Authorization error
.
Illeagal command: if it is not begun with "domain extension: command title"
4001 action is illegal(:createDomain)
.
Your balance is in debit.
4004 userid:* No enough Money(need * )
.
2. Tab <resdata> indicates returned data information.
You must take a record of the returned <domain:name><domain:roid><domain:contact>, since you may use it for check or modification later.
The specific information, you can consult the code inforamtion of the Appendix of "Domain registration Client XML Userguide".
⌨️ 快捷键说明
复制代码
Ctrl + C
搜索代码
Ctrl + F
全屏模式
F11
切换主题
Ctrl + Shift + D
显示快捷键
?
增大字号
Ctrl + =
减小字号
Ctrl + -