• If you are still using CentOS 7.9, it's time to convert to Alma 8 with the free centos2alma tool by Plesk or Plesk Migrator. Please let us know your experiences or concerns in this thread:
    CentOS2Alma discussion

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.
 

Similar threads

N
Replies
3
Views
3K
NicolasR
N
J
Replies
5
Views
3K
holykim66
H
N
Replies
0
Views
2K
Nate Custer
N
Back
Top