• Our team is looking to connect with folks who use email services provided by Plesk, or a premium service. If you'd like to be part of the discovery process and share your experiences, we invite you to complete this short screening survey. If your responses match the persona we are looking for, you'll receive a link to schedule a call at your convenience. We look forward to hearing from you!
  • We are looking for U.S.-based freelancer or agency working with SEO or WordPress for a quick 30-min interviews to gather feedback on XOVI, a successful German SEO tool we’re looking to launch in the U.S.
    If you qualify and participate, you’ll receive a $30 Amazon gift card as a thank-you. Please apply here. Thanks for helping shape a better SEO product for agencies!
  • The Horde webmail has been deprecated. Its complete removal is scheduled for April 2025. For details and recommended actions, see the Feature and Deprecation Plan.

CreateSite2 api

K

kbessinger

Guest
I am trying to create a site using PHP and soap, per the example in the documentation

Here is what my code looks like:


$siteService = new Utils_SoapClient($serviceUrl.'/SiteWebService.asmx?WSDL', array("trace"=>1, "exception"=>0));
$siteService->setCredentialsHeader($serviceLogin, $servicePassword);

$struct = new stdClass();
$struct->ownerId = $accountId;
$struct->siteType = 'Regular';
$struct->siteAlias = 'newdomain.com';
$struct->hostId = '66961197-e6e4-e017-15e7-087892279b4d';
$struct->publishingSettings = new stdClass();
$struct->publishingSettings->Scenario = 'Standard';
$struct->publishingSettings->Mode = 'Ftp';
$struct->publishingSettings->StandardLocation = new stdClass();
$struct->publishingSettings->StandardLocation->UserName = 'newdomain';
$struct->publishingSettings->StandardLocation->Password = 'password';
$struct->publishingSettings->StandardLocation->WorkingDirectory = '/httpdocs/';
$struct->publishingSettings->StandardLocation->WebSiteUrl = 'http://newdomain.com';
$struct->publishingSettings->StandardLocation->Address = 'ftp://newdomain.com';
$struct->publishingSettings->StandardLocation->Veid = 0;
$result = $siteService->CreateSite2(new SoapVar($struct, SOAP_ENC_OBJECT));
$siteId = $result->CreateSite2Result->Id;

And I can see that im sending up the publishingSettings, but the only one that updates is the WebSiteUrl. The rest come back as blank in the response and don't get set.

See as follows:

Request:
<?xml version="1.0" encoding="UTF-8"?>
<SOAP-ENV:Envelope xmlns:SOAP-ENV="http://schemas.xmlsoap.org/soap/envelope/" xmlns:ns1="http://swsoft.com/webservices/sb/4.0/SiteService"><SOAP-ENV:Header><ns1:CredentialsSoapHeader><ns1:Login>blah</ns1:Login><ns1:password>blah</ns1:password></ns1:CredentialsSoapHeader></SOAP-ENV:Header><SOAP-ENV:Body><ns1:CreateSite2><ownerId>162a6a09-6741-93a6-d868-42deb4bbd0b4</ownerId><siteType>Regular</siteType><siteAlias>newdomain.com</siteAlias><hostId>66961197-e6e4-e017-15e7-087892279b4d</hostId><publishingSettings><Scenario>Standard</Scenario><Mode>Ftp</Mode><StandardLocation><UserName>newdomain</UserName><Password>password</Password><WorkingDirectory>/httpdocs/</WorkingDirectory><WebSiteUrl>http://newdomain.com</WebSiteUrl><Address>ftp://newdomain.com</Address><Veid>0</Veid></StandardLocation></publishingSettings></ns1:CreateSite2></SOAP-ENV:Body></SOAP-ENV:Envelope>

Response:
<?xml version="1.0" encoding="UTF-8"?>
<SOAP-ENV:Envelope xmlns:SOAP-ENV="http://schemas.xmlsoap.org/soap/envelope/" xmlns:ns1="http://swsoft.com/webservices/sb/4.0/SiteService"><SOAP-ENV:Body><ns1:CreateSite2Response><ns1:CreateSite2Result><ns1:Id>49d1d1e8ebd1763ca2380e061f5eba42</ns1:Id><ns1:Alias>newdomain.com</ns1:Alias><ns1:OwnerId>162a6a09-6741-93a6-d868-42deb4bbd0b4</ns1:OwnerId><ns1:OwnerUserName>TestUser</ns1:OwnerUserName><ns1:IsActive>true</ns1:IsActive><ns1:publishingSettings><ns1:Id>c0ee7ed5-060f-5549-0efc-f179ab6b6059</ns1:Id><ns1:StandardLocation><ns1:Address></ns1:Address><ns1:UserName></ns1:UserName><ns1:password></ns1:password><ns1:WorkingDirectory></ns1:WorkingDirectory><ns1:WebSiteUrl>http://newdomain.com/</ns1:WebSiteUrl><ns1:IsAnonymous>false</ns1:IsAnonymous><ns1:Veid>0</ns1:Veid><ns1:VerifyStatus>Unverified</ns1:VerifyStatus><ns1:LastVerifyAttempt>1969-12-31T18:00:00-06:00</ns1:LastVerifyAttempt><ns1:FallbackIP></ns1:FallbackIP><ns1:HostId>00000000-0000-0000-0000-000000000000</ns1:HostId></ns1:StandardLocation><ns1:Mode>Ftp</ns1:Mode></ns1:publishingSettings><ns1:HostId>00000000-0000-0000-0000-000000000000</ns1:HostId><ns1:ResellerId>00000000-0000-0000-0000-000000000000</ns1:ResellerId><ns1:ResellerUserName>admin</ns1:ResellerUserName><ns1:CreationDate>2007-12-17T13:52:19-06:00</ns1:CreationDate></ns1:CreateSite2Result></ns1:CreateSite2Response></SOAP-ENV:Body></SOAP-ENV:Envelope>
 
ah never mind, didn't realize what the <Address> field was for. Once i put the ip address of the ftp server, it worked. Guess without a valid ip address, it will not save some of the other settings.
 

Similar threads

K
Replies
1
Views
4K
KemalE
K
N
Replies
3
Views
3K
NicolasR
N
J
Replies
5
Views
4K
holykim66
H
I
Replies
0
Views
2K
ilkerburak
I
Back
Top