SiteWebService.CreateSiteWithHost Method 

Creates host, add host to a user plan, create a site with standard publishing settings and associatre the site with the host.

[C#]
public SiteValue CreateSiteWithHost(
   string ownerId,
   string alias,
   string ipAddress,
   string publishUsername,
   string publishPassword,
   string publishWorkingDirectory,
   string publishWebSiteUrl
);

Parameters

ownerId
Account ID of a site owner.
alias
Site name.
ipAddress
Host address (IP format only).
publishUsername
Publishing settings login.
publishPassword
Publishing settings password.
publishWorkingDirectory
Publishing settings working directory.
publishWebSiteUrl
URL to access published web site.

Return Value

SiteValue object.

Remarks

  1. Create a host with the specified address for a user specified in SOAP-header (see CredentialsSoapHeader). If a host with the address already exists, the method will perform the following steps:
  2. Add the host to the plan chosen for the user specified by username
  3. Create a site for the user with standard publishing settings on the host received at the first step and other publishing settings supplied by appropriate parameters: publishUsername, publishPassword, publishWorkingDirectory publishWebSiteUrl.

Example SOAP 1.1

Request
POST /wsb/ServiceFacade/4.0/SiteWebService.asmx HTTP/1.1
Host: localhost
Content-Type: text/xml; charset=utf-8
Content-Length: length
SOAPAction: "http://swsoft.com/webservices/sb/4.0/SiteService/CreateSiteWithHost"

<?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:Header>
    <CredentialsSoapHeader xmlns="http://swsoft.com/webservices/sb/4.0/SiteService">
      <SsoSessionId>string</SsoSessionId>
      <SsoId>string</SsoId>
      <Login>string</Login>
      <Password>string</Password>
    </CredentialsSoapHeader>
  </soap:Header>
  <soap:Body>
    <CreateSiteWithHost xmlns="http://swsoft.com/webservices/sb/4.0/SiteService">
      <ownerId>string</ownerId>
      <alias>string</alias>
      <ipAddress>string</ipAddress>
      <publishUsername>string</publishUsername>
      <publishPassword>string</publishPassword>
      <publishWorkingDirectory>string</publishWorkingDirectory>
      <publishWebSiteUrl>string</publishWebSiteUrl>
    </CreateSiteWithHost>
  </soap:Body>
</soap:Envelope>
Response
HTTP/1.1 200 OK
Content-Type: text/xml; charset=utf-8
Content-Length: length

<?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>
    <CreateSiteWithHostResponse xmlns="http://swsoft.com/webservices/sb/4.0/SiteService">
      <CreateSiteWithHostResult>
        <Id>string</Id>
        <Alias>string</Alias>
        <OwnerId>string</OwnerId>
        <OwnerUserName>string</OwnerUserName>
        <IsActive>boolean</IsActive>
        <PublishingSettings>
          <Id>string</Id>
          <StandardLocation>
            <Address>string</Address>
            <UserName>string</UserName>
            <Password>string</Password>
            <WorkingDirectory>string</WorkingDirectory>
            <WebSiteUrl>string</WebSiteUrl>
            <IsAnonymous>boolean</IsAnonymous>
            <Veid>long</Veid>
            <VerifyStatus>Unverified or LocationError or UnknownError or StaticOnly or Dynamic</VerifyStatus>
            <LastVerifyAttempt>dateTime</LastVerifyAttempt>
            <FallbackIP>string</FallbackIP>
            <HostId>string</HostId>
          </StandardLocation>
          <Mode>XCopy or Ftp or Vps or VpsLinux or Unknown</Mode>
        </PublishingSettings>
        <LastPublishingSettings>
          <Id>string</Id>
          <StandardLocation>
            <Address>string</Address>
            <UserName>string</UserName>
            <Password>string</Password>
            <WorkingDirectory>string</WorkingDirectory>
            <WebSiteUrl>string</WebSiteUrl>
            <IsAnonymous>boolean</IsAnonymous>
            <Veid>long</Veid>
            <VerifyStatus>Unverified or LocationError or UnknownError or StaticOnly or Dynamic</VerifyStatus>
            <LastVerifyAttempt>dateTime</LastVerifyAttempt>
            <FallbackIP>string</FallbackIP>
            <HostId>string</HostId>
          </StandardLocation>
          <Mode>XCopy or Ftp or Vps or VpsLinux or Unknown</Mode>
        </LastPublishingSettings>
        <HostId>string</HostId>
        <ResellerId>string</ResellerId>
        <ResellerUserName>string</ResellerUserName>
        <CreationDate>dateTime</CreationDate>
      </CreateSiteWithHostResult>
    </CreateSiteWithHostResponse>
  </soap:Body>
</soap:Envelope>

See Also

SiteWebService Web Service | Web services