Soap api v4_1 is not working with php 8 must be a valid callback, non-static method SugarWebServiceImplv4_1::login() #4840

Open
opened 2026-02-20 16:24:51 -05:00 by deekerman · 0 comments
Owner

Originally created by @rahulshinde19 on GitHub (Aug 25, 2022).

Soap api v4_1 failing while calling any method
We are using SuiteCRM version 7.12.7 with PHP 8.0.13
while calling Soap api we are getting following error.

<faultstring xsi:type="xsd:string">Unknown error in SOAP call: service died unexpectedly</faultstring>
         <detail xsi:type="xsd:string"><![CDATA[<br />
<b>Fatal error</b>:  Uncaught TypeError: call_user_func_array(): Argument #1 ($callback) must be a valid callback, non-static method SugarWebServiceImplv4_1::login() cannot be called statically in C:\xampp80\htdocs\SuiteCRM-7.12.7\include\nusoap\nusoap.php:5437
Stack trace:
#0 C:\xampp80\htdocs\SuiteCRM-7.12.7\include\nusoap\nusoap.php(5054): nusoap_server-&gt;invoke_method()
#1 C:\xampp80\htdocs\SuiteCRM-7.12.7\service\core\NusoapSoap.php(93): nusoap_server-&gt;service('&lt;soapenv:Envelo...')
#2 C:\xampp80\htdocs\SuiteCRM-7.12.7\service\core\webservice.php(70): NusoapSoap-&gt;serve()
#3 C:\xampp80\htdocs\SuiteCRM-7.12.7\service\v4_1\soap.php(56): require_once('C:\\xampp80\\htdo...')
#4 {main}
  thrown in <b>C:\xampp80\htdocs\SuiteCRM-7.12.7\include\nusoap\nusoap.php</b> on line <b>5437</b><br />]]></detail>

Expected Behavior

The login soap v4_1 API should return session token and other api should work

Actual Behavior

It is returning error for all APIs
The function call_user_func_array throwing fatal error in PHP 8 if the function is not static. In the code call_user_func_array is calling method statically but all methods are not declared as non-static

Possible Fix

In include/nusoap/nusoap.php line number 5428 the control should not go into elseif ($delim == '..') this condition. it should go to else instead.

Steps to Reproduce

Call soap api service/v4_1/soap.php with parameters

Your Environment

  • SuiteCRM Version used: 7.12.7
  • Browser name and version (e.g. Chrome Version 51.0.2704.63 (64-bit)):
  • Environment name and version (e.g. MySQL, PHP 8.0.13):
  • Operating System and version (e.g RedHat 8.6):
Originally created by @rahulshinde19 on GitHub (Aug 25, 2022). Soap api v4_1 failing while calling any method We are using SuiteCRM version 7.12.7 with PHP 8.0.13 while calling Soap api we are getting following error. ``` <faultstring xsi:type="xsd:string">Unknown error in SOAP call: service died unexpectedly</faultstring> <detail xsi:type="xsd:string"><![CDATA[<br /> <b>Fatal error</b>: Uncaught TypeError: call_user_func_array(): Argument #1 ($callback) must be a valid callback, non-static method SugarWebServiceImplv4_1::login() cannot be called statically in C:\xampp80\htdocs\SuiteCRM-7.12.7\include\nusoap\nusoap.php:5437 Stack trace: #0 C:\xampp80\htdocs\SuiteCRM-7.12.7\include\nusoap\nusoap.php(5054): nusoap_server-&gt;invoke_method() #1 C:\xampp80\htdocs\SuiteCRM-7.12.7\service\core\NusoapSoap.php(93): nusoap_server-&gt;service('&lt;soapenv:Envelo...') #2 C:\xampp80\htdocs\SuiteCRM-7.12.7\service\core\webservice.php(70): NusoapSoap-&gt;serve() #3 C:\xampp80\htdocs\SuiteCRM-7.12.7\service\v4_1\soap.php(56): require_once('C:\\xampp80\\htdo...') #4 {main} thrown in <b>C:\xampp80\htdocs\SuiteCRM-7.12.7\include\nusoap\nusoap.php</b> on line <b>5437</b><br />]]></detail> ``` #### Expected Behavior The login soap v4_1 API should return session token and other api should work #### Actual Behavior It is returning error for all APIs The function `call_user_func_array` throwing fatal error in `PHP 8` if the function is not static. In the code `call_user_func_array` is calling method statically but all methods are not declared as non-static #### Possible Fix In `include/nusoap/nusoap.php` line number `5428` the control should not go into `elseif ($delim == '..')` this condition. it should go to `else` instead. #### Steps to Reproduce Call soap api `service/v4_1/soap.php` with parameters #### Your Environment * SuiteCRM Version used: 7.12.7 * Browser name and version (e.g. Chrome Version 51.0.2704.63 (64-bit)): * Environment name and version (e.g. MySQL, PHP 8.0.13): * Operating System and version (e.g RedHat 8.6):
Sign in to join this conversation.
No milestone
No project
No assignees
1 participant
Notifications
Due date
The due date is invalid or out of range. Please use the format "yyyy-mm-dd".

No due date set.

Dependencies

No dependencies set.

Reference
starred/SuiteCRM-SuiteCRM#4840
No description provided.