• 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 BIND DNS server has already been deprecated and removed from Plesk for Windows.
    If a Plesk for Windows server is still using BIND, the upgrade to Plesk Obsidian 18.0.70 will be unavailable until the administrator switches the DNS server to Microsoft DNS. We strongly recommend transitioning to Microsoft DNS within the next 6 weeks, before the Plesk 18.0.70 release.
  • The Horde component is removed from Plesk Installer. We recommend switching to another webmail software supported in Plesk.

Using the GetAccountByName method

E

eric4gh

Guest
Hi. I am building an API between WHMcs and Sitebuilder. I have automatic user/site creation working. Now I wish to delete a certain account. However, I am receiving this error when using the GetAccountByName method.

Listed below this error message is the code where I am using that method.:

Type: SoapFault
Message: Generic error. Internal Sitebuilder error. Base_SyntaxException: PHP Notice : Undefined property: stdClass::$username file: /usr/local/sitebuilder/include/SB/Actions/Admin/User/GetAccount.php line: 60 code: 8
Fault code: ERROR_GENERIC
Details: Internal Sitebuilder error. Base_SyntaxException: PHP Notice : Undefined property: stdClass::$username file: /usr/local/sitebuilder/include/SB/Actions/Admin/User/GetAccount.php line: 60 code: 8
File: /home/goodhost/public_html/billing3/includes/actionhooks.php
Line: 340
Code: 0

Code the generates this error:

$struct->username = $vars["username"]; // retrieves user name from WHMcs system

print $vars["username"];
print "<p>";
print_r($struct->username);

$accountService = $this->_getWebService('/AccountWebService.asmx?WSDL');

// first we must search to see if the username exists as a site in sitebuilder.

$result = $accountService->GetAccountByName($struct->username);

// then if there is a match, delete that site

$result2 = $accountService->DeleteAccount(new SoapVar($result, SOAP_ENC_OBJECT));

~~~

I have also tried using the method by supplying a variable and the hardcoded string "sitetest1" for example, and the same error message above is generated.

I have also passed in an account object

$struct->username = $vars["username"];

$result = $accountService->GetAccountByName(new SoapVar($struct, SOAP_ENC_OBJECT));

but the same error is generated.

Can anyone tell me how I should be using the GetAccountByName API method to process correctly?

Thank you.
 
Back
Top