|
Version: 7C
HC7 Build: 7.00.0012 and later
API Build: 1.00.0001 and later
Domain Manager - AddSubDomain adds a sub domain under a specified website. This web service call can be made as http://your-domain.com/HC7API/DomainManager.asmx?op=AddSubDomain.
Input Parameters
HostUserName
HostPassword
OwnerName - owner name who is going to add sub domain
SubDomainName - name of sub domain to be added
WebsiteName - top level domain name which exists in HC7
SubDomainOwner - webadmin name under which you want to add this sub domain
SubDomainType- IPBased/NameBased
SoldPlanID - Unique identification number of plan already sold to WebsiteOwner, with desired resource quota in it
Note : SoldPlanID the unique identification number, can be retrieved using GetSoldPlans.
|
IPAddress - IP address of website (if WebsiteType parameter is set to IPBased), IPLessDomainIP (if WebsiteType parameter is set to NameBased)
Note : IP Address list can be retrieved using GetFreeIPList or GetIPLessDomainIPList method of ServerManager.
|
OptionalParam
DNSServerName - if sent, DNS will be created
on specified server otherwise loadbalancing will be
done
AllowAnonymous True/False - default value will be set to True
ReadAcess True/False - default value will be set to True
WriteAccess True/False - default value will be set to False
ScriptSourceAccess True/False - default value will be set to True
ExecuteAccess True/False - default value will be set to False
DirectoryBrowsingAccess True/False - default value will be set to False
FrontPageExtensionsAccess True/False - default value will be set to False
EnableDefaultDocument True/False - default value will be set to True
DefaultDocumentList - comma separated list of default documents for this website, default value will be set to "default.html,default.htm,default.asp,default.aspx,index.htm,index.html,index.cfm,index.asp,index.aspx"
TemporaryVirDirectory - send if you want to create temporary virtual directory in case of NameBased site
Language
Output Parameters
N/A
Sample Optional Parameters
<Parameters>
<Parameter Name = "TemporaryVirDirectory">MyDomain.com</Parameter>
<Parameter Name = "WriteAccess">True</Parameter>
<Parameter Name = "FrontPageExtensionsAccess">True</Parameter>
</Parameters>
Sample SOAP Request
POST /HC7API/DomainManager.asmx HTTP/1.1
Host: your-domain.com
Content-Type: text/xml; charset=utf-8
Content-Length: length
SOAPAction: "http://tempuri.org/AddSubDomain"
<?xml version="1.0" encoding="utf-8"?>
<soap:Envelope xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xmlns:xsd="http://www.w3.org/2001/XMLSchema" xmlns:soap="http://schemas.xmlsoap.org/soap/envelope/">
<soap:Body>
<AddSubDomain xmlns="http://tempuri.org/">
<HostUserName>host</HostUserName>
<HostPassword>host123</HostPassword>
<OwnerName>david</OwnerName>
<SubDomainName>MySubDomain</SubDomainName>
<WebsiteName>MyDomain.com</WebsiteName>
<SubDomainOwner>john</SubDomainOwner>
<SubDomainType>NameBased</SubDomainType>
<SoldPlanID>12</SoldPlanID>
<DNSServerName>abc</DNSServerName>
<OptionalParam>xml</OptionalParam>
</AddSubDomain>
</soap:Body>
</soap:Envelope>
Sample HTTP Request
POST /HC7API/DomainManager.asmx/AddSubDomain HTTP/1.1
Host: your-domain.com
Content-Type: application/x-www-form-urlencoded
Content-Length: length
HostUserName=host&HostPassword=host123&OwnerName=david&SubDomainName=MySubDomain&WebsiteName=
MyDomain.com&SubDomainOwner=john&SubDomainType=NameBased&SoldPlanID=12&DNSServerName=abc
&OptionalParam=xml
Sample C# Code
public DomainManager.Response AddSubDomain(string strHostUserName, string strHostPassword, string strOwnerName, string strSubDomainName, string strWebsiteName, string strSubDomainOwner, string SubDomainType, int nSoldPlanID, string DNSServerName)
{
try
{
DomainManager.DomainManager oDomain = new DomainManager.DomainManager();
DomainManager.Response oResponse = new DomainManager.Response();
XmlDocument oDoc = new XmlDocument();
//Adding root node
XmlNode xOptionalParam = oDoc.CreateNode(XmlNodeType.Element,"Parameters","");
//Adding sub nodes
XmlNode xParameter = oDoc.CreateNode(XmlNodeType.Element,"Parameter","");
XmlAttribute xAttribute = oDoc.CreateAttribute("Name");
xAttribute.Value = "TemporaryVirDirectory";
xParameter.Attributes.Append(xAttribute);
xParameter.InnerText = "MyDomain.com";
xOptionalParam.AppendChild(xParameter);
.......
.......
.......
oResponse
= oDomain.AddSubDomain(strHostUserName, strHostPassword, strOwnerName,
strSubDomainName, strWebsiteName, strSubDomainOwner, SubDomainType, nSoldPlanID,
DNSServerName, OptionalParam);
}
catch
{
}
return oResponse;
}
Sample Response
<Response>
<Method>AddPlan</ Method>
<Status>true</Status>
<ErrorCode>70700011</ErrorCode>
<ErrorDescription>Sub Domain created successfully.</ErrorDescription>
<Result/>
</Response>