Force.com-Toolkit-for-PHP icon indicating copy to clipboard operation
Force.com-Toolkit-for-PHP copied to clipboard

[PHP8] Namespace does not get set causing ValueError in SoapHeader class

Open cyrus-discuss opened this issue 4 years ago • 1 comments

Throws Error

$client = new SforceEnterpriseClient();
$client->setSessionHeader(...);
/*
  Throws following error:
  ValueError: SoapHeader::__construct(): Argument #1 ($namespace) cannot be empty in /vendor/developerforce/force.com-toolkit-for-php/soapclient/SforceBaseClient.php:377
*/

Word-around

$client = new SforceEnterpriseClient();
$client->SforceEnterpriseClient();
$client->setSessionHeader(...);

cyrus-discuss avatar Feb 12 '21 01:02 cyrus-discuss

Works for SforcePartnerClient() as well. Thanks!

$client = new SforcePartnerClient();
$client->SforcePartnerClient();

z4phodB avatar Jul 16 '22 05:07 z4phodB