• We value your experience with Plesk during 2026
    Please help us understand which Plesk features made your work easier this year, what is still missing and how AI should help you in Plesk ?
    Take this short 5-minutes survey. Your answers go straight into the Plesk roadmap for 2027.

API UpdateSite problem

N

NicolasR

Guest
Hello,

I'm currently use UpdateSite method of ServiceFacade/4.5/

I would like change the name of anonymous web site to more 'human readable' like "my site 1"

I use the method UpdateSite that contain theses parameters :

id (i suppose Site_Id)
alias (name of website)
publishSettings template

following this XML schema :

<s:complexType name="PublishingSettingsValue">
<s:sequence>
<s:element minOccurs="0" maxOccurs="1" name="Id" type="s:string"/>
<s:element minOccurs="1" maxOccurs="1" name="StandardLocation" type="tns:LocationSettings"/>
<s:element minOccurs="1" maxOccurs="1" name="Mode" type="tns:publishMode"/>
</s:sequence>
</s:complexType>
<s:complexType name="LocationSettings">
<s:sequence>

<s:element minOccurs="0" maxOccurs="1" name="Address" type="s:string"/>
<s:element minOccurs="0" maxOccurs="1" name="UserName" type="s:string"/>
<s:element minOccurs="0" maxOccurs="1" name="Password" type="s:string"/>
<s:element minOccurs="0" maxOccurs="1" name="WorkingDirectory" type="s:string"/>
<s:element minOccurs="0" maxOccurs="1" name="WebSiteUrl" type="s:string"/>
<s:element minOccurs="1" maxOccurs="1" name="IsAnonymous" type="s:boolean"/>
<s:element minOccurs="1" maxOccurs="1" name="Veid" type="s:long"/>
<s:element minOccurs="1" maxOccurs="1" name="VerifyStatus" type="tns:LocationStatus"/>
<s:element minOccurs="1" maxOccurs="1" name="LastVerifyAttempt" type="s:dateTime"/>

<s:element minOccurs="0" maxOccurs="1" name="FallbackIP" type="s:string"/>
<s:element minOccurs="0" maxOccurs="1" name="HostId" type="s:string"/>
</s:sequence>


But when i call the fonction i get this :
object(SoapFault)#78 (9) {
["message:protected"] => string(196) "Generic error. Internal Sitebuilder error.
Base_SyntaxException: PHP Notice : Undefined property: stdClass::$hostId


My code :

$struct = new stdClass();
$struct->id = $_siteId;
$struct->alias = $_siteName;
$struct->publishingSettings = new stdClass();
$struct->publishingSettings->Id='';
$struct->publishingSettings->StandardLocation = new stdClass();
$struct->publishingSettings->StandardLocation->Address = '';
$struct->publishingSettings->StandardLocation->UserName = '';
$struct->publishingSettings->StandardLocation->Password = '';
$struct->publishingSettings->StandardLocation->WorkingDirectory = '';
$struct->publishingSettings->StandardLocation->WebSiteUrl = '';
$struct->publishingSettings->StandardLocation->IsAnonymous = 'true';
$struct->publishingSettings->StandardLocation->Veid = 0;
$struct->publishingSettings->StandardLocation->VerifyStatus = 'Unverified';
$struct->publishingSettings->StandardLocation->LastVerifyAttempt = '0000-00-00 00:00:00';
$struct->publishingSettings->StandardLocation->FallbackIP = '';
$struct->publishingSettings->HostId='';
$struct->publishingSettings->Mode = 'Ftp';

$res = $this->Site->UpdateSite($struct);

What's is wrong ?
 
Hi again,

Now i have no error msg, but the publication parameter doesn't work :

(following the http://download1.parallels.com/SiteBuilder/4.5.0/doc/api/ref_manual/en_US/html/4.5/index.html schema)

object(stdClass)#83 (3) {
["id"] => string(32) "82981a93e6ee42a80df255258ed3275e"
["alias"] => string(16) "My first website"
["publishingSettings"] => object(stdClass)#81 (3) {
["Id"] => string(32) "82981a93e6ee42a80df255258ed3275e"
["StandardLocation"] => object(stdClass)#82 (11) {
["Address"] => string(17) "hostname.com"
["UserName"] => string(9) "loginname"
["Password"] => string(6) "somepassword"
["WorkingDirectory"] => string(7) "/site1/" (<--- ftp works, url is correct)
["WebSiteUrl"] => string(28) "http://url-website.com"
["IsAnonymous"] => string(5) "false"
["Veid"] => int(0)
["VerifyStatus"] => string(10) "Unverified"
["LastVerifyAttempt"] => string(19) "0000-00-00 00:00:00"
["FallbackIP"] => string(13) ""
["HostId"] => int(3) ------------------> (read 3 that's correspond to IP address added in admin panel (i read the number when i'm try to "edit" the ip address (edit/3))
}
["Mode"] => string(3) "Ftp"
}
}

the api return nothing (null) so i think the request is valid
When i try to publish the website in admin panel, i got an error message : error publication settings are not available..

... need help..
 
Back
Top